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
1
Amber::Server.configure do
2
pipeline :api do
3
plug Pipe::CORS.new
4
end
5
6
routes :api do
7
# your routes here...
8
end
9
end
Copied!
Also see pipelines.
Last modified 3yr ago
Copy link