diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-26 00:39:25 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-26 00:39:25 -0400 |
commit | 6a8540c1a2ae61d81e06eae2865ac00c6c759ed5 (patch) | |
tree | 6feac702f75b080de2e32da02d2fde308e183a6c /Assistant | |
parent | 805d50c69d40be97baa28735371778df63b5fed6 (diff) |
tweak
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/Threads/WebApp.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Assistant/Threads/WebApp.hs b/Assistant/Threads/WebApp.hs index d475865dc..d9b648831 100644 --- a/Assistant/Threads/WebApp.hs +++ b/Assistant/Threads/WebApp.hs @@ -37,12 +37,14 @@ getConfigR = defaultLayout [whamlet|<a href=@{HomeR}>main|] webAppThread :: ThreadState -> DaemonStatusHandle -> IO () webAppThread st dstatus = do - app <- toWaiApp (WebApp dstatus) + app <- toWaiApp webapp app' <- ifM debugEnabled ( return $ httpDebugLogger app , return app ) - runWebApp app' $ \p -> runThreadState st $ writeHtmlShim p + runWebApp app' $ \port -> runThreadState st $ writeHtmlShim port + where + webapp = WebApp dstatus {- Creates a html shim file that's used to redirect into the webapp. -} writeHtmlShim :: PortNumber -> Annex () @@ -53,13 +55,13 @@ writeHtmlShim port = do {- TODO: generate this static file using Yesod. -} genHtmlShim :: PortNumber -> L.ByteString genHtmlShim port = renderHtml [shamlet| -!!! +$doctype 5 <html> <head> <meta http-equiv="refresh" content="0; URL=#{url}"> <body> <p> - <a href="#{url}">Starting webapp... + <a href=#{url}">Starting webapp... |] where url = "http://localhost:" ++ show port ++ "/" |