Skip to content

rmhaiderali/serve-static-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

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")}'

Environment Variables:

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

Arguments:

Options Discription Type Default
root directory to serve string "."
options serve-static options object serve-static options '{dotfiles: "allow"}'

About

Serve static files from cli using https://github.com/expressjs/serve-static

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors