This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@wize/runtime-load-routes

1.1.5 • Public • Published

@wize/runtime-load-routes

Description

Registers routes for custom APIs defined in apis directory.

Usage

Installation

npm install --save @wize/runtime-load-routes

Initialize

import runtime from '@wize/runtime-load-routes';
.
.
.
/*
app: koa-app returned from 'const app = createServer({});'
directory: current directory containing all API folders
opts: JSON object; example: {isAPI: true}
events: JSON object containing pre and post events to be attached to each route; example: { pre: [setUserObjectInContext], post: []}
*/
runtime(app, directory, {
    isAPI: true
  }, events);

Sample API directory

project
└───api
   └───audits
       └───GET
              index.js
              config.json
      index.js
└───sources
   └───postgres
          index.js
   app.js
   README.md

##License MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i @wize/runtime-load-routes

Weekly Downloads

0

Version

1.1.5

License

MIT

Last publish

Collaborators

  • at1nder
  • harishtejwani
  • praveennegi