diff --git a/app/Backend/Backend.hs b/app/Backend/Backend.hs index 0229b90..47a611a 100644 --- a/app/Backend/Backend.hs +++ b/app/Backend/Backend.hs @@ -9,7 +9,9 @@ import qualified Backend.Http as HTTP #ifdef HTTPS_SUPPORT import qualified Backend.Https as HTTPS #endif - +#ifdef FASTCGI_SUPPORT +import qualified Backend.FastCGI as FASTCGI +#endif -- maybe we want a String instead of T.Text depends on -- the argument parser @@ -35,5 +37,8 @@ backends = #endif #ifdef HTTPS_SUPPORT BackendWithConfig HTTPS.forkHttpsBackend "https" "Host as as simple https server, using Warp" : +#endif +#ifdef FASTCGI_SUPPORT + BackendWithoutConfig FASTCGI.forkFastCGIBackend "fastcgi" "Deploy with fastcgi" : #endif [] diff --git a/app/Backend/FastCGI.hs b/app/Backend/FastCGI.hs index e51ba7d..28b2ea1 100644 --- a/app/Backend/FastCGI.hs +++ b/app/Backend/FastCGI.hs @@ -1 +1,9 @@ module Backend.FastCGI where + +import Config +import qualified Network.Wai as Wai +import qualified Network.Wai.Handler.FastCGI as Fcgi +import Control.Concurrent.MVar + +forkFastCGIBackend :: Wai.Application -> IO [MVar ()] +forkFastCGIBackend = fmap (: []) . forkBackend . Fcgi.run