2.3.0 • Published 8 years ago

neuron-dev-server v2.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Build Status

neuron-dev-server

neuron-dev-server is a static file server and reverse proxy.

Install

$ npm install neuron-dev-server --save

Usage

For example, in conjunction with Express

var middleware = require('neuron-dev-server');

var options = {
  routers: [
    {
      // defines it as default
      default: true,

      // If the `req.url` matches `location`
      location: '/mod',

      // Then we will search the static file from
      root: '/path/to/mod',
      
      // If not found, then bypass to:
      by_pass: 'http://domain.com/mod'

      // If by_pass not specified, then `next()` will be called
    },

    {
      location: '/static',
      root: '/path/to/static'
    },

    ...
  ],

  // All requests will be fallback to:
  by_pass: 'http://domain.com'
};


var app = require('express')();

app
  // Use neuron-dev-server middleware for express
  .use(middleware(options))
  .listen(8000);

middleware.options(options)

Static method to clean the options.

License

MIT

2.3.0

8 years ago

2.2.0

8 years ago

2.1.3

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago