This recipe will help you to setup a Hello World!
response in your /hello
path.
First you need an amber project generated with Amber CLI or from scratch.
First create a src/controllers/hello_controller.cr
file and add this:
src/controllers/hello_controller.crclass HelloController < ApplicationControllerdef hello"Hello Amber!"endend
Then add a new route in your config/routes.cr
file:
Amber::Server.configure do |app|pipeline :web do# pipelines...end​routes :web do# other routes,,,get "/hello", HelloController, :helloendend
​