summaryrefslogtreecommitdiff
path: root/Assistant/Threads/WebApp.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Assistant/Threads/WebApp.hs')
-rw-r--r--Assistant/Threads/WebApp.hs10
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 ++ "/"