0.1.8 • Published 6 years ago

gilmoreg-nodesvc v0.1.8

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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.