NOTICE: Since light is a work in progress, breaking changes will be made every MINOR patch until 2.0

light.js

a

framework

CircleCI  NPM  Downloads  Stars  Coveralls
as simple as
light dev
$ light dev
> start      🔥 igniting the server 🔥
> listening  on port 3000
> hmr        starting the hot reloader
> hmr        watching for changes
  GET        200 to /, request completed in 1 ms
const { createRoute } = require('light');
const { route, addMiddleware, addPlugin } = createRoute('index');

addMiddleware(auth, cors);
addPlugin(errorHandling);
module.exports = route((req, res) => {
  return {
    hello: 'world',
  };
});

reload without actually reloading
don't waste your time waiting for your server to restart
$ light dev
> listening on port 3000
> routes/index.js changed
hot-swapping file
> done [1 ms]
$ node express.js
> listening on port 3000
> routes/index.js changed
restarting server
reimporting all routes
reconnecting to database
reconnecting to cache
recompiling templates
> listening on port 3000
> done [1-5 s]

write once
deploy anywhere
const { createRoute } = require('light');
const { route, addMiddleware, addPlugin } = createRoute('index');

process.env.LIGHT_ENV = 'now';

addMiddleware(auth, cors);
addPlugin(errorHandling);
module.exports = route((req, res) => {
  return {
    hello: 'world',
  };
});

try it yourself
on RunKit