forked from filipg/gonito
Add CORS
This commit is contained in:
parent
dd5338c251
commit
a0577ba249
@ -28,6 +28,7 @@ import Network.Wai.Middleware.RequestLogger (Destination (Logger),
|
||||
IPAddrSource (..),
|
||||
OutputFormat (..), destination,
|
||||
mkRequestLogger, outputFormat)
|
||||
import Network.Wai.Middleware.Cors
|
||||
import System.Log.FastLogger (defaultBufSize, newStdoutLoggerSet,
|
||||
toLogStr)
|
||||
|
||||
@ -145,7 +146,7 @@ makeApplication foundation = do
|
||||
|
||||
-- Create the WAI application and apply middlewares
|
||||
appPlain <- toWaiAppPlain foundation
|
||||
return $ logWare $ defaultMiddlewaresNoLogging appPlain
|
||||
return $ logWare $ defaultMiddlewaresNoLogging $ simpleCors appPlain
|
||||
|
||||
makeLogWare :: App -> IO Middleware
|
||||
makeLogWare foundation =
|
||||
|
@ -151,6 +151,7 @@ library
|
||||
, megaparsec
|
||||
, Glob
|
||||
, req
|
||||
, wai-cors
|
||||
|
||||
executable gonito
|
||||
if flag(library-only)
|
||||
|
Loading…
Reference in New Issue
Block a user