Skip to content

openapi-routes 4.0.0

Install from the command line:
Learn more about npm packages
$ npm install @ponbike/openapi-routes@4.0.0
Install via package.json:
"@ponbike/openapi-routes": "4.0.0"

About this version

Node CI Bugs Code Smells Duplicated Lines (%) Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities Quality Gate Status Coverage

OpenAPI routes

Example usage

import express from 'express'
import { ApiRoutes } from '@ponbike/openapi-routes'
import { OpenAPIBackend } from 'openapi-backend'
import { logger as stackdriver } from '@ponbike/logger-stackdriver'
import { makeExpressCallback } from '@hckrnews/express-callback'

const logger = stackdriver()

const { api: apiRoutes } = ApiRoutes.create({
  specification,
  secret: 'exampleSecret,
  Backend: OpenAPIBackend,
  logger,
  errorLogger: {
    error: (err) => logger.error(err)
  }
  controllers,
  callback: makeExpressCallback,
  root: '/',
  meta: {
    example: 'test'
  },
  requestValidation: true,
  responseValidation: true
})

const router = express.Router()

router.use((request, response) =>
  apiRoutes.handleRequest(
    request,
    request,
    response
  )
)

Details


Assets

  • openapi-routes-4.0.0-npm.tgz

Download activity

  • Total downloads 3,919
  • Last 30 days 0
  • Last week 0
  • Today 0