play-examples-route 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Routes
  2. # Contains each of the example definitions from the official documentation:
  3. # https://www.playframework.com/documentation/latest/ScalaRouting
  4. # Some examples are altered slightly to be compatible with the other examples or
  5. # to allow for multiple supported combinations with the RPC-Rest syntax.
  6. # Shared Route
  7. GET /clients/:id controllers.Clients.show(id: Long)
  8. # Shared Route
  9. # Display a client.
  10. GET /clients/display/:id controllers.Clients.display(id: Long)
  11. # Not yet supported
  12. # -> /api api.MyRouter
  13. + nocsrf
  14. # Shared Route
  15. POST /api/new controllers.Api.newThing
  16. # Shared Route
  17. + nocsrf
  18. POST /api/make controllers.Api.makeThing
  19. # Shared Route
  20. GET /clients/all controllers.Clients.listAll()
  21. # Shared Route
  22. GET /files/*name controllers.Application.download(name)
  23. # Shared Route
  24. GET /items/$id<[0-9]+> controllers.Items.show(id: Long)
  25. # Shared Route
  26. GET / controllers.Application.homePage()
  27. # Shared Route
  28. # Extract the page parameter from the path, or fix the value for /
  29. GET / controllers.Application.show(page = "home")
  30. # Shared Route
  31. # Extract the page parameter from the path.
  32. GET /:page controllers.Application.show(page)
  33. # Shared Route
  34. # Extract the page parameter from the query string.
  35. GET / controllers.Application.display(page)
  36. # Shared Route
  37. # Pagination links, like /clients?page=3
  38. GET /clients controllers.Clients.list(page: Int ?= 1)
  39. # Shared Route
  40. # The version parameter is optional. E.g. /api/list-all?version=3.0
  41. GET /api/list-all controllers.Api.list(version: Option[String])
  42. # Shared Route
  43. # Redirects to https://www.playframework.com/ with 303 See Other
  44. GET /about controllers.Default.redirect(to = "https://www.playframework.com/")
  45. # Shared Route
  46. # Responds with 404 Not Found
  47. GET /orders controllers.Default.notFound
  48. # Shared Route
  49. # Responds with 500 Internal Server Error
  50. GET /clients controllers.Default.error
  51. # Shared Route
  52. # Responds with 501 Not Implemented
  53. GET /posts controllers.Default.todo