Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A stand-alone HTTP server written in NodeJS
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
.gitignore
LICENSE
LICENSE.MIT
README.md
package.json

README.md

You Got ServeD!

served is a stand-alane command-line webserver

Think python -m SimpleHTTPServer 3000, but it can also handle streaming media (via Content-Range header) and accepts file uploads (very safely, see below).

Installation

npm install -g served

Usage

served [port] [/path/to/serve] # defaults to 3000 and the current directory

example:

cd ~/Downloads
served 5555

Note: If /path/to/serve can be loaded as a connect module with require(), it will be. For example:

served 5555 /path/to/myapp.js

Note: Due to connectjs' security policy, you may not use relative paths to parent directories ../! Use either absolute or child-relative paths.

Receiving Files

Files will NOT be overwritten.

Files will be received to the filename they were posted as.

cd /tmp
served 5555 &

cd ~/
echo 'Hello Test World!' > hello-test.txt
curl http://localhost:5555/ignored-path/hello.txt \
  -X POST \
  --data-binary @hello-test.txt

cat /tmp/hello.txt
> Hello Test World!

License

Copyright (c) 2011 AJ ONeal under the MIT and Apachev2 Licenses.

See LICENSE.MIT

Something went wrong with that request. Please try again.