add cors_plug

This commit is contained in:
Pierre de Lacroix 2026-01-23 00:08:18 +01:00
parent 66a45b0fb1
commit 6f80299dbc
Signed by: lateralus23
GPG key ID: 53E0CEC29C24EF39
3 changed files with 6 additions and 3 deletions

View file

@ -1,12 +1,13 @@
defmodule CampApiWeb.Router do
use CampApiWeb, :router
pipeline :api do
pipeline :public_api do
plug :accepts, ["json"]
plug CORSPlug, origin: ["*"]
end
scope "/api", CampApiWeb do
pipe_through :api
pipe_through :public_api
get "/gauge", GristController, :gauge