Add flag --document-root for user with gf --server

This can make it easier to test cloud service updates before installing them.
This commit is contained in:
hallgren
2012-11-14 13:52:45 +00:00
parent 0ef7b8a3b5
commit 586d7488f2
3 changed files with 13 additions and 5 deletions

View File

@@ -47,12 +47,12 @@ import RunHTTP(cgiHandler)
debug s = logPutStrLn s
-- | Combined FastCGI and HTTP server
server port execute1 state0 =
server port optroot execute1 state0 =
do --stderrToFile logFile
state <- newMVar M.empty
cache <- PS.newPGFCache
datadir <- getDataDir
let root = datadir</>"www"
let root = maybe (datadir</>"www") id optroot
-- debug $ "document root="++root
setCurrentDirectory root
-- FCGI.acceptLoop forkIO (handle_fcgi execute1 state0 state cache)