1.0.0-alpha • Published 7 years ago

wwwserve v1.0.0-alpha

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

wwwserve

A simple web-server written in Node.js

Please note

This is still in development and a number of things are still not implmented. Please use the issues tab whenever possible.

What's the point of this?

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.

Install

You must have Git, Node.js and NPM installed.

git clone https://github.com/thegreatrazz/wwwserve.git
npm install
npm link

Usage

wwwserve [options] <directory>

Options

ShortLongArgumentsExplanation
-v--versionnoneoutput the version number
-p--portport number (integer)HTTP port (defaults to 3000)
-e--error-404filenamecustom 404 page (defaults to 404.html)
-d--no-dir-listingnonereturn 404 in index-less directory
-i--indexfilename (string)custom filename for directory index
-h--helpnoneoutput usage information

Examples

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.

Exit codes

CodeMeaning
0Everything is A-OK!
1Directory not found
2...

Help out with the project

See CONTRIBUTING.md and the Wiki page for more information.