mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 12:45:59 +02:00
serve: add page (#7741)
This commit is contained in:
parent
78b4e55964
commit
8ba9ec2b37
1 changed files with 32 additions and 0 deletions
32
pages/common/serve.md
Normal file
32
pages/common/serve.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# serve
|
||||
|
||||
> Static file serving and directory listing.
|
||||
> More information: <https://github.com/vercel/serve>.
|
||||
|
||||
- Start an HTTP server listening on the default port to serve the current directory:
|
||||
|
||||
`serve`
|
||||
|
||||
- Start an HTTP server on a specific [p]ort to serve a specific directory:
|
||||
|
||||
`serve -p {{port}} {{path/to/directory}}`
|
||||
|
||||
- Start an HTTP server with CORS enabled by including the `Access-Control-Allow-Origin: *` header in all responses:
|
||||
|
||||
`serve --cors`
|
||||
|
||||
- Start an HTTP server on the default port rewriting all not-found requests to the `index.html` file:
|
||||
|
||||
`serve --single`
|
||||
|
||||
- Start an HTTPS server on the default port using the specified certificate:
|
||||
|
||||
`serve --ssl-cert {{path/to/cert.pem}} --ssl-key {{path/to/key.pem}}`
|
||||
|
||||
- Start an HTTP server on the default port using a specific configuration file:
|
||||
|
||||
`serve --config {{path/to/serve.json}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`serve --help`
|
Loading…
Add table
Reference in a new issue