A simple web-server written in Node.js
This is still in development and a number of things are still not implmented. Please use the issues tab whenever possible.
The point of this is for me to get my hands dirty and learn Node.js web servery things.
This is meant to be simplistic. For now, the idea is to have this in the command-line, ready to fire when I need a static web server up. Namely testing non-Jekyll GitHub Pages stuff.
I know similar tools which do the same thing (and probably better), such as sèvè.
Hopefully, whatever this is will be a framework for another project I have planned down the pipeline. Don't quote me on that, though.
You must have Git, Node.js and NPM installed.
git clone https://github.com/thegreatrazz/wwwserve.git
npm install
npm link
wwwserve [options] <directory>
Short | Long | Arguments | Explanation |
---|---|---|---|
-v |
--version |
none | output the version number |
-p |
--port |
port number (integer) | HTTP port (defaults to 3000) |
-e |
--error-404 |
filename | custom 404 page (defaults to 404.html ) |
-d |
--no-dir-listing |
none | return 404 in index-less directory |
-i |
--index |
filename (string) | custom filename for directory index |
-h |
--help |
none | output usage information |
wwwserve ~/Sites/ --port 80
Run a website from the folder ~/Sites
on port 80.
wwwserve C:\Users\thegreatrazz\Documents\GitHub\website\ -DE --port 8080
Run a website from the folder C:\Users\thegreatrazz\Documents\GitHub\website\
on port 8080.
Don't show the files in an index-less directory. Omit file extentions when possible.
Code | Meaning |
---|---|
0 |
Everything is A-OK! |
1 |
Directory not found |
2 |
... |
See CONTRIBUTING.md and the Wiki page for more information.