Skip to content

Commit

Permalink
feat: allow www.gloogle.run in CORS
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Hivert <[email protected]>
  • Loading branch information
ghivert committed May 14, 2024
1 parent 4a68051 commit 7fc7d32
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/backend/src/backend/web.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ pub fn foundations(req: Request, handler: Handler) -> Response {

pub fn cors() {
let origin = case config.is_dev() {
True -> "http://localhost:5173"
False -> "https://gloogle.run"
True -> cors.allow_origin(_, "http://localhost:5173")
False -> fn(cors) {
cors
|> cors.allow_origin("https://gloogle.run")
|> cors.allow_origin("https://www.gloogle.run")
}
}
cors.new()
|> cors.allow_origin(origin)
|> origin()
|> cors.allow_method(http.Get)
|> cors.allow_method(http.Post)
|> cors.allow_method(http.Put)
Expand Down

0 comments on commit 7fc7d32

Please sign in to comment.