// Load configs or create custom objectconstconfig=loadConfig();// Create a server instanceconstserver=newRestServer(config);// Load all middle-wares required for rest API developmentserver.pre();// router groupletrouter=server.router();// bind some routesrouter.get('/two',(req,res)=>{res.send({now: (Date.now()),two: true})});// binding any router// or middlewareserver.use(router);// bind 404, exception handling, terminating middle-ware and start listening.server.post().terminating().listen();
Supported config variables
BODY_SIZE_LIMIT, Default: '100kb'
DEFAULT_ERROR_MESSAGE, Default: 'Internal Server Error'