on master help sign in
add CORS for getting deps-info.json
commit81a38d6e29eab7e4e4c4c1acad35ec6fa7144cae authorEvan Czaplicki <evancz@users.noreply.github.com> dateSat 28 Sep 2019, 00:49 (7 years ago) parent64b460e
1 file changed+3−1
worker/src/Main.hs+3−1
worker/src/Main.hs+3−1
@@ -11,6 +11,7 @@ import Snap.Core
1111import Snap.Http.Server
1212
1313import qualified Artifacts
14+import qualified Cors
1415import qualified Endpoint.Compile as Compile
1516import qualified Endpoint.Repl as Repl
1617
@@ -31,7 +32,8 @@ main =
3132 , path "repl" $ Repl.endpoint rArtifacts
3233 , path "compile" $ Compile.endpoint cArtifacts
3334 , path "compile/errors.js" $ writeBS errorJS
34− , path "compile/deps-info.json" $ writeBS depsInfo
35+ , path "compile/deps-info.json" $
36+ Cors.allow GET ["https://elm-lang.org"] (writeBS depsInfo)
3537 , notFound
3638 ]
3739