Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gerjs-koa

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gerjs-koa

Use gerJs library plus use the models to validate and reformat the input/ouput payload in the API

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

[BETA] koa-gerJs

Use gerJs library plus use the models to validate and reformat the input/ouput payload in the API.

Example : https://github.com/dobobaie/example-koa-gerjs-server

Help us to improve the project by contributing 👥

☁️ Installation

$ npm install gerjs-koa

📝 Usage

Use gerjs-core documentation to create modelsAPI file.

Initialization

Create a new instance :

Then create the models. Joi is required.

const modelsAPI = require("./models/models");
const gerJs = require("gerjs-koa")({
  // same gerjs-core options | except `destinationPath` is not available
  exportTo: 'path/doc', // string ; optional
})(modelsAPI);

⚙️ GerJs initialization in Koa side

const Koa = require("koa");
const router = require("koa-router");

const app = new Koa();

// please use all the middlewares before
app.use(gerJs.middleware(router)); // middleware to validate payload and reformat reponse | required

app.use(
	router
	  // routes...
	  .get("/swagger", gerJs.expose()) // expose the swagger documentation | optional
	  .get("*", ctx => ctx.throw(boom.notFound()))
	  .routes()
	);

👥 Contributing

Please help us to improve the project by contributing :)

❓️ Testing

Clone the repo and run from the project root:

$ npm install
$ npm test

Keywords

FAQs

Package last updated on 02 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc