Given a freshly scaffolded Yesod application, what is the minimal set of changes necessary to get an executable which acts as a CGI program? A wrapper program is acceptable. If the default executable built by ‘cabal build’ is a CGI program, what environment variables must be set for it to act as a CGI (as by default it will bind to a port and attempt to serve requests there.)
A similar answer for FastCGI would also be appreciated.
Update your
app/main.hswith the following:You’ll need to add
wai-extrato the dependencies in your cabal file. To use FastCGI instead, replaceNetwork.Wai.Handler.CGIwithNetwork.Wai.Handler.FastCGIand addwai-handler-fastcgito the dependency list instead.