Node
npx github:rmhaiderali/serve-static-cli <root> <options>Bun
bunx --bun github:rmhaiderali/serve-static-cli <root> <options>Deno
deno -A https://raw.githubusercontent.com/rmhaiderali/serve-static-cli/refs/heads/deno/index.js <root> <options>Default values
npx github:rmhaiderali/serve-static-cli . "{}"Disable index
npx github:rmhaiderali/serve-static-cli . "{index: false}"Set headers
npx github:rmhaiderali/serve-static-cli . '{setHeaders: (res) => res.setHeader("powered-by", "serve-static-cli")}'| Variable | Purpose |
|---|---|
| HOST | Network interface to listen on |
| PORT | Port number to listen on |
| BASE | Base path for the served files |
| DIR_LISTING | Display directory content, true or false |
| Options | Discription | Type | Default |
|---|---|---|---|
| root | directory to serve | string | "." |
| options | serve-static options object | serve-static options |
'{dotfiles: "allow"}' |