@@ -32,7 +32,7 @@ main =
32 [ ifTop $ status
32 [ ifTop $ status
33 , path "repl" $ Repl.endpoint rArtifacts
33 , path "repl" $ Repl.endpoint rArtifacts
34 , path "compile" $ Compile.endpoint cArtifacts
34 , path "compile" $ Compile.endpoint cArtifacts
35− , path "compile/errors.js" $ writeBS errorJS
35+ , path "compile/errors.js" $ serveJavaScript errorJS
36 , path "compile/deps-info.json" $ serveDepsInfo depsInfo
36 , path "compile/deps-info.json" $ serveDepsInfo depsInfo
37 , notFound
37 , notFound
@@ -56,6 +56,12 @@ notFound =
56 writeBuilder "Not Found"
56 writeBuilder "Not Found"
59+serveJavaScript :: BS.ByteString -> Snap ()
60+serveJavaScript javascript =
61+ do modifyResponse $ setContentType "application/javascript"
59serveDepsInfo :: BS.ByteString -> Snap ()
65serveDepsInfo :: BS.ByteString -> Snap ()
60serveDepsInfo json =
66serveDepsInfo json =
61 Cors.allow GET ["https://elm-lang.org"] $
67 Cors.allow GET ["https://elm-lang.org"] $