on master help sign in
Fixed CORS issue
commit49e71ddd7825a64d3c147db96b37fdf203a82c95 authorilyakooo0 <ilyakooo0@gmail.com> dateTue 22 Jan 2019, 19:58 (8 years ago) parent77167fc
2 files changed+3−1
app/Main.hs+2−1 package.yaml+1
app/Main.hs+2−1
@@ -4,6 +4,7 @@ import Network.Wai.Handler.Warp (run)
44import Servant.Server (serve)
55import System.Environment
66import Lib
7+import Network.Wai.Middleware.Cors
78
89main :: IO ()
910main = do
@@ -12,4 +13,4 @@ main = do
1213 putStrLn $ "Starting on port: " ++ show port
1314 print env
1415 srv <- createServer
15− run port $ serve server srv
16+ run port $ simpleCors $ serve server srv
package.yaml+1
@@ -36,6 +36,7 @@ dependencies:
3636- servant-websockets
3737- websockets
3838- lens
39+- wai-cors
3940
4041library:
4142 source-dirs: src