1.1.2 • Published 4 years ago

@certik/serverless-api-doc v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Serverless API Doc

A package to make it easy to serve openAPI doc for your serverless API

Usage:

# src/doc.js

const path = require("path");
const YAML = require("yamljs");
const createDocHandler = require("@certik/serverless-api-doc");

const openAPIDocument = YAML.load(path.resolve(__dirname, "./openapi.yaml"));

module.exports.handler = createDocHandler({
  productionStageName: "prod",
  basePath: "/doc",
  openAPIDocument
});
# serverless.yml

functions:
  doc:
    handler: src/doc.handler
    events:
      - http:
            path: /doc
            method: get
      - http:
            method: get
            path: /doc/{proxy+}

Publish

yarn publish --access public