tldr/pages/common/live-server.md

21 lines
471 B
Markdown
Raw Normal View History

2017-12-10 22:51:53 +00:00
# live-server
> A simple development http server with live reload capability.
2019-06-05 08:55:54 +01:00
> More information: <https://www.npmjs.com/package/live-server>.
2017-12-10 22:51:53 +00:00
- Serve an `index.html` file and reload on changes:
2017-12-10 22:51:53 +00:00
`live-server`
2017-12-13 19:15:59 +00:00
- Specify a port (default is 8080) from which to serve a file:
2017-12-10 22:51:53 +00:00
2017-12-11 03:34:49 +00:00
`live-server --port={{8081}}`
2017-12-10 22:51:53 +00:00
2017-12-11 03:37:01 +00:00
- Specify a given file to serve:
2017-12-10 22:51:53 +00:00
2017-12-11 03:34:49 +00:00
`live-server --open={{about.html}}`
2017-12-10 22:51:53 +00:00
2017-12-11 03:37:01 +00:00
- Proxy all requests for ROUTE to URL:
2017-12-10 22:51:53 +00:00
2017-12-11 03:34:49 +00:00
`live-server --proxy={{/}}:{{http:localhost:3000}}`