mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-20 02:37:12 +03:00
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
|
||||
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
|
||||
[
|
||||
|
Loading…
Reference in New Issue
Block a user