Allow CORS

This commit is contained in:
Alex Ling
2022-03-20 09:57:36 +00:00
parent 703e6d076b
commit 2091053221
5 changed files with 51 additions and 7 deletions
+8
View File
@@ -0,0 +1,8 @@
class CORSHandler < Kemal::Handler
def call(env)
if request_path_startswith env, ["/api"]
env.response.headers["Access-Control-Allow-Origin"] = "*"
end
call_next env
end
end