Merge pull request #151 from xiaoruoruo/staticroot

docs: new option --static-root
This commit is contained in:
Simon Michael 2013-12-15 22:23:17 -08:00
commit 62160ee82c
2 changed files with 15 additions and 4 deletions

View File

@ -891,12 +891,13 @@ web-specific options:
--server log requests, don't exit on inactivity --server log requests, don't exit on inactivity
--port=N serve on tcp port N (default 5000) --port=N serve on tcp port N (default 5000)
--base-url=URL use this base url (default http://localhost:PORT/PATH) --base-url=URL use this base url (default http://localhost:PORT/)
--static-root=URL use this base url for static files (default http://localhost:PORT/static)
By default, the web command starts a transient local web app and displays it in your default web browser ("local ui mode"). By default, the web command starts a transient local web app and displays it in your default web browser ("local ui mode").
With `--server`, it starts the web app, leaves it running, and also logs requests to the console ("server mode"). With `--server`, it starts the web app, leaves it running, and also logs requests to the console ("server mode").
Typically in server mode you'll also want to use use Typically in server mode you'll also want to use
`--base-url` to set the protocol/hostname/port/path to be used in `--base-url` to set the protocol/hostname/port/path to be used in
hyperlinks. hyperlinks.
@ -904,6 +905,12 @@ You can use `--port` to listen on a different TCP port, eg if you are running mu
instances. Note `--port`'s argument need not be the same as the PORT instances. Note `--port`'s argument need not be the same as the PORT
in the base url. in the base url.
The more advanced option `--static-root` allows the static files served from a
separate base url. This enables the optimization that the static files can be
served from a generic web server like apache, which is good at handling static
files and caching. One can also serve the files in a separate domain to reduce
cookies overhead.
**Note:** unlike any other hledger command, `web` can alter existing journal **Note:** unlike any other hledger command, `web` can alter existing journal
data, via the edit form. A numbered backup of the file is saved on data, via the edit form. A numbered backup of the file is saved on
each edit, normally (ie if file permissions allow, disk is not full, etc.) each edit, normally (ie if file permissions allow, disk is not full, etc.)

View File

@ -4,6 +4,10 @@ title: hledger news
# News # News
## unreleased
- web: new option `--static-root` to set the base url for static files
## 2013/12/13 hledger 0.22 ## 2013/12/13 hledger 0.22
**New:** **New:**