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

light.js

a

serverless

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 { route } = require('light');
const { handler, middleware, plugin } = route();

middleware(auth, cors);
plugin(errorHandling);
module.exports = handler((req, res) => {
  return {
    hello: 'world',
  };
});

reload without actually reloading

dont 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]
vs
$ 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 { route } = require('light');
const { handler, middleware, plugin } = route();



middleware(auth, cors);
plugin(errorHandling);
module.exports = handler((req, res) => {
  return {
    hello: 'world',
  };
});