1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/serve.md
Managor 6619ffbc43
fdisk, sops, ack, box, crictl, gprbuild, serve, shellcheck, xidel, zgep: add option placeholders and minor fixes (#16160)
* Update fdisk.md

* sops

* ack

* box

* crictl

* gprbuild

* serve

* shellcheck

* xidel

* zgep
2025-04-12 14:42:06 +02:00

908 B

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 {{[-C|--cors]}}

  • Start an HTTP server on the default port rewriting all not-found requests to the index.html file:

serve {{[-s|--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 {{[-c|--config]}} {{path/to/serve.json}}

  • Display help:

serve --help