web: show url when starting web ui
This commit is contained in:
parent
959e99fda9
commit
aa4fab9468
@ -31,15 +31,17 @@ web opts args l = do
|
|||||||
simpleHTTP nullConf{port=tcpport} $ handlers opts args l t
|
simpleHTTP nullConf{port=tcpport} $ handlers opts args l t
|
||||||
else do
|
else do
|
||||||
-- start the server (in background, so we can..) then start the web browser
|
-- 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
|
tid <- forkIO $ simpleHTTP nullConf{port=tcpport} $ handlers opts args l t
|
||||||
putStrLn "starting web browser"
|
putStrLn "starting web browser"
|
||||||
openBrowserOn $ printf "http://localhost:%d/" tcpport
|
openBrowserOn homeurl
|
||||||
waitForTermination
|
waitForTermination
|
||||||
putStrLn "shutting down web server..."
|
putStrLn "shutting down web server..."
|
||||||
killThread tid
|
killThread tid
|
||||||
putStrLn "shutdown complete"
|
putStrLn "shutdown complete"
|
||||||
|
|
||||||
|
homeurl = printf "http://localhost:%d/" tcpport
|
||||||
|
|
||||||
handlers :: [Opt] -> [String] -> Ledger -> LocalTime -> ServerPartT IO Response
|
handlers :: [Opt] -> [String] -> Ledger -> LocalTime -> ServerPartT IO Response
|
||||||
handlers opts args l t = msum
|
handlers opts args l t = msum
|
||||||
[
|
[
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user