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 (..),
|
IPAddrSource (..),
|
||||||
OutputFormat (..), destination,
|
OutputFormat (..), destination,
|
||||||
mkRequestLogger, outputFormat)
|
mkRequestLogger, outputFormat)
|
||||||
|
import Network.Wai.Middleware.Cors
|
||||||
import System.Log.FastLogger (defaultBufSize, newStdoutLoggerSet,
|
import System.Log.FastLogger (defaultBufSize, newStdoutLoggerSet,
|
||||||
toLogStr)
|
toLogStr)
|
||||||
|
|
||||||
@ -145,7 +146,7 @@ makeApplication foundation = do
|
|||||||
|
|
||||||
-- Create the WAI application and apply middlewares
|
-- Create the WAI application and apply middlewares
|
||||||
appPlain <- toWaiAppPlain foundation
|
appPlain <- toWaiAppPlain foundation
|
||||||
return $ logWare $ defaultMiddlewaresNoLogging appPlain
|
return $ logWare $ defaultMiddlewaresNoLogging $ simpleCors appPlain
|
||||||
|
|
||||||
makeLogWare :: App -> IO Middleware
|
makeLogWare :: App -> IO Middleware
|
||||||
makeLogWare foundation =
|
makeLogWare foundation =
|
||||||
|
@ -151,6 +151,7 @@ library
|
|||||||
, megaparsec
|
, megaparsec
|
||||||
, Glob
|
, Glob
|
||||||
, req
|
, req
|
||||||
|
, wai-cors
|
||||||
|
|
||||||
executable gonito
|
executable gonito
|
||||||
if flag(library-only)
|
if flag(library-only)
|
||||||
|
Loading…
Reference in New Issue
Block a user