web: show url when starting web ui

This commit is contained in:
Simon Michael 2009-06-28 21:30:23 +00:00
parent 959e99fda9
commit aa4fab9468

View File

@ -31,15 +31,17 @@ web opts args l = do
simpleHTTP nullConf{port=tcpport} $ handlers opts args l t
else do
-- start the server (in background, so we can..) then start the web browser
putStrLn $ printf "starting web server on port %d" tcpport
printf "starting web interface at %s\n" homeurl
tid <- forkIO $ simpleHTTP nullConf{port=tcpport} $ handlers opts args l t
putStrLn "starting web browser"
openBrowserOn $ printf "http://localhost:%d/" tcpport
openBrowserOn homeurl
waitForTermination
putStrLn "shutting down web server..."
killThread tid
putStrLn "shutdown complete"
homeurl = printf "http://localhost:%d/" tcpport
handlers :: [Opt] -> [String] -> Ledger -> LocalTime -> ServerPartT IO Response
handlers opts args l t = msum
[