CORS
This recipe will help you to setup a Cross-Origin Resource Sharing pipe in your application.
First you need an amber project generated with Amber CLI or from scratch.
config/application.cr
Amber::Server.configure do
pipeline :api do
plug Pipe::CORS.new
end
routes :api do
# your routes here...
end
end
Also see pipelines.