on master help sign in
add CORS for getting deps-info.json
81a38d6Evan Czaplicki
worker/src/Main.hs+3−1
@@ -11,6 +11,7 @@ import Snap.Core
11import Snap.Http.Server
11import Snap.Http.Server
12
12
13import qualified Artifacts
13import qualified Artifacts
14+import qualified Cors
14import qualified Endpoint.Compile as Compile
15import qualified Endpoint.Compile as Compile
15import qualified Endpoint.Repl as Repl
16import qualified Endpoint.Repl as Repl
16
17
@@ -31,7 +32,8 @@ main =
31 , path "repl" $ Repl.endpoint rArtifacts
32 , path "repl" $ Repl.endpoint rArtifacts
32 , path "compile" $ Compile.endpoint cArtifacts
33 , path "compile" $ Compile.endpoint cArtifacts
33 , path "compile/errors.js" $ writeBS errorJS
34 , 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)
35 , notFound
37 , notFound
36 ]
38 ]
37
39