We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecb8183 commit 5ab4b87Copy full SHA for 5ab4b87
worker/src/Main.hs
@@ -32,7 +32,7 @@ main =
32
[ ifTop $ status
33
, path "repl" $ Repl.endpoint rArtifacts
34
, path "compile" $ Compile.endpoint cArtifacts
35
- , path "compile/errors.js" $ writeBS errorJS
+ , path "compile/errors.js" $ serveJavaScript errorJS
36
, path "compile/deps-info.json" $ serveDepsInfo depsInfo
37
, notFound
38
]
@@ -56,6 +56,12 @@ notFound =
56
writeBuilder "Not Found"
57
58
59
+serveJavaScript :: BS.ByteString -> Snap ()
60
+serveJavaScript javascript =
61
+ do modifyResponse $ setContentType "application/javascript"
62
+ writeBS javascript
63
+
64
65
serveDepsInfo :: BS.ByteString -> Snap ()
66
serveDepsInfo json =
67
Cors.allow GET ["https://elm-lang.org"] $
0 commit comments