@@ -32,7 +32,7 @@ main =
3232 [ ifTop $ status
3333 , path "repl" $ Repl.endpoint rArtifacts
3434 , path "compile" $ Compile.endpoint cArtifacts
35− , path "compile/errors.js" $ writeBS errorJS
35+ , path "compile/errors.js" $ serveJavaScript errorJS
3636 , path "compile/deps-info.json" $ serveDepsInfo depsInfo
3737 , notFound
3838 ]
@@ -56,6 +56,12 @@ notFound =
5656 writeBuilder "Not Found"
5757
5858
59+serveJavaScript :: BS.ByteString -> Snap ()
60+serveJavaScript javascript =
61+ do modifyResponse $ setContentType "application/javascript"
62+ writeBS javascript
63+
64+
5965serveDepsInfo :: BS.ByteString -> Snap ()
6066serveDepsInfo json =
6167 Cors.allow GET ["https://elm-lang.org"] $