gilmoreg-nodesvc

Node starter

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gilmoreg-nodesvc
0.1.86 years ago6 years agoMinified + gzip package size for gilmoreg-nodesvc in KB

Readme

nodesvc

Usage

const express = require('express');
const { init, start, stop } = require('../');
const swagger = require('./swagger.json');

init({
  router,             // optional, default null - routes will be appended with /api
  rootRouter,         // optional, default null - routes will install directly on /
  swagger,            // optional, default {}
  middleware: [],     // optional, default []
  url: 'localhost',   // optional, default 'localhost'
  port: 3000,         // optional, default 3000
  corsOptions = {     // optional, default as shown
    origin: true,
    credentials: true,
    maxAge: 86400
  }
});

const server = await start(app);

Please see /samples for example usage.