Gérer sa collection de jeux vidéos, consoles et figurines. Et plus si affinités.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.cr 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Amber::Server.configure do
  2. pipeline :web do
  3. # Plug is the method to use connect a pipe (middleware)
  4. # A plug accepts an instance of HTTP::Handler
  5. plug Amber::Pipe::PoweredByAmber.new
  6. # plug Amber::Pipe::ClientIp.new(["X-Forwarded-For"])
  7. plug Citrine::I18n::Handler.new
  8. plug Amber::Pipe::Error.new
  9. plug Amber::Pipe::Logger.new
  10. plug Amber::Pipe::Session.new
  11. plug Amber::Pipe::Flash.new
  12. plug Amber::Pipe::CSRF.new
  13. end
  14. pipeline :api do
  15. plug Amber::Pipe::PoweredByAmber.new
  16. plug Amber::Pipe::Error.new
  17. plug Amber::Pipe::Logger.new
  18. plug Amber::Pipe::Session.new
  19. plug Amber::Pipe::CORS.new
  20. end
  21. # All static content will run these transformations
  22. pipeline :static do
  23. plug Amber::Pipe::PoweredByAmber.new
  24. plug Amber::Pipe::Error.new
  25. plug Amber::Pipe::Static.new("./public")
  26. end
  27. routes :web do
  28. get "/", HomeController, :index
  29. end
  30. routes :api do
  31. end
  32. routes :static do
  33. # Each route is defined as follow
  34. # verb resource : String, controller : Symbol, action : Symbol
  35. get "/*", Amber::Controller::Static, :index
  36. end
  37. end