From 766274415364e65f8d6c5d020ccc1550f06d5072 Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Thu, 18 Mar 2021 18:13:47 +0100 Subject: [PATCH] added fastcgi support --- app/Backend/Backend.hs | 7 ++++++- app/Backend/FastCGI.hs | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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