1.4.2 • Published 12 years ago
served v1.4.2
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 servedUsage
served [port] [/path/to/serve] # defaults to 3000 and the current directoryexample:
cd ~/Downloads
served 5555Note: If /path/to/serve can be loaded as a connect module with require(), it will be. For example:
served 5555 /path/to/myapp.jsNote: 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