Skip to content

A super fast web server for serving front-end resources

Notifications You must be signed in to change notification settings

xneelo/wc-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

wc-server

A super fast web server for serving front-end resources.

Built with koa.

This server is perfect for developing bower_components.

Installation

First, install npm (assuming you have pre-installed node.js).

Globally install the server.

$ npm install -g hetznerZA/wc-server

or

Add it as a project dependency.

$ npm install hetznerZA/wc-server --save-dev

Usage

$ wc-server

  A simple web server to serve front-end resources.

Options

  -p, --port number   The port to serve from. Defaults to 8080.
  -c, --component     Serve bower_components directory on root.
  -o, --cors          Enable CORS by setting Access-Control-Allow-Origin headers.
  -n, --no-cache      Set no-cache headers.
  -s, --https         Enable HTTPS.
  -i, --history       History API support. Fallback to root.
  -v, --version       Display version info.
  -h, --help          Display this usage guide.

Examples

Run as a bower component development environment.

$ wc-server --component --no-cache

Run with HTTPS enabled

$ wc-server -s

Use as a module

var server = require('wc-server');
var options = {
  https: true,
  'no-cache': true
};
var app = server(options);
var port = process.env.PORT || 8080;
app.listen(port, function() {
  console.log(`Server is running on port ${port}`);
});

Development

Install dependencies

$ npm install

Create a symlink for npm --global development

$ sudo npm link

Run tests

$ npm test

Todo

  • HTTP2 / Spdy
  • Import headers config file
  • Set custom main file

License

MIT

About

A super fast web server for serving front-end resources

Resources

Stars

Watchers

Forks

Packages

No packages published