Skip to content
/ servedir Public
forked from remy/servedir

Creates a simple node based web server for a directory

Notifications You must be signed in to change notification settings

evanw/servedir

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

servedir

servedir is a simple Node web server for offline development and testing: running servedir from a directory will create a quick local web server. servedir is useful for developing scripts that require a standard web environment and can't use the file:// protocol.

The annotated source code is included in the docs/ folder.

Installation

Check out a working copy of the source code with Git, or install servedir via npm. The latter will also install servedir into the system's bin path.

$ git clone [email protected]:evanw/servedir.git
$ npm install secure-servedir -g

Alternatively, servedir can be run directly from the repository using Node:

$ node bin/servedir
$ ./bin/servedir

Usage

servedir [path] [port] [--external]

  • path - The location to serve files and directories from. Defaults to the current working directory.
  • port - The port number. Default to 8000.
  • --external - If specified, this flag exposes the server to the rest of the network. The server only binds to the internal loopback interface by default.

Example

$ servedir ~/Documents/example 8001
$ servedir ~/Documents/example
$ servedir ~/Documents/example --external
$ servedir 8001
$ servedir

Contributors

About

Creates a simple node based web server for a directory

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%