Skip to content
/ mad Public

Convenience local web server for front-end development

License

Notifications You must be signed in to change notification settings

raffecat/mad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAD web server

Convenience local web server for front-end development.

  • .html masking: /users.html is served as /users
  • Slow responses: adds 100ms to simulate network delays.
  • Case-sensitivity: warn if url casing doesn't match the file system.
  • Proxy /api/ to any url, e.g. real rest api, aws lambdas.
  • Reports missing files and actual file paths (no guessing)

This server is not appropriate for production; use Nginx instead.

Installing

MAD requires node.js and is installed and run from the terminal or command prompt.

npm install -g mad

Using

MAD will serve files from the current directory unless you use the -d option.

% mad -m
MAD: serving /home/bob/folio/static on http://localhost:8000/ [mask .html]

Help

% mad help

Usage: mad [directory] [options]  (use -s0 or --no-s to turn off -s etc)

Options:
  -a, --access  Access log (log every request)         [boolean] [default: true]
  -B, --bind    IP address to listen on          [string] [default: "localhost"]
  -p, --port    TCP port to listen on                   [number] [default: 8000]
  -s, --slow    Serve files slowly (can specify ms delay)         [default: 100]
  -m, --mask    Mask the .html extension on .html files[boolean] [default: true]
  -r, --redir   Redirect .html paths to remove .html   [boolean] [default: true]
  -b, --block   Block .html paths to test masked URLs [boolean] [default: false]
  -P, --proxy   Proxy /api/ URLs (trims /api/ prefix)     [string] [default: ""]
  -w, --wait    Wait for an API request (specify /path/to/api)
                                                           [array] [default: ""]
  -h, --help    Show help                                              [boolean]

About

Convenience local web server for front-end development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published