added CGI backend (hopefully)

This commit is contained in:
Dennis Frieberg 2021-03-30 14:23:58 +02:00
parent 7662744153
commit 2611bdd254
2 changed files with 15 additions and 1 deletions

View file

@ -12,6 +12,9 @@ import qualified Backend.Https as HTTPS
#ifdef FASTCGI_SUPPORT
import qualified Backend.FastCGI as FASTCGI
#endif
#ifdef CGI_SUPPORT
import qualified Backend.CGI as CGI
#endif
-- maybe we want a String instead of T.Text depends on
-- the argument parser
@ -40,5 +43,8 @@ backends =
#endif
#ifdef FASTCGI_SUPPORT
BackendWithoutConfig FASTCGI.forkFastCGIBackend "fastcgi" "Deploy with fastcgi" :
#endif
#ifdef CGI_SUPPORT
BackendWithoutConfig CGI.forkCGIBackend "cgi" "Deploy with cgi" :
#endif
[]

View file

@ -1,4 +1,12 @@
module Backend.CGI where
module Backend.CGI(forkCGIBackend) where
import Config
import qualified Network.Wai as Wai
import qualified Network.Wai.Handler.CGI as CGI
import Control.Concurrent.MVar
forkCGIBackend :: Wai.Application -> IO [MVar ()]
forkCGIBackend = fmap (: []) . forkBackend . CGI.run