swagpi

0.1.1 • Public • Published

Swagpi

JSON-based API docs that look swag


Swagpi helps you create pretty, interactive docs for your REST API with JSON.

Getting Started

You can get up and running in 30 seconds:

npm i swagpi

const swagpi = require('swagpi')
const app = express()
 
swagpi(app, {
    path: '/api',
    logo: './logo.png',
    config: {
        "Users": [
            {
                verb: 'GET',
                route: "/user",
                title: "Get all users",
                description: "Pulls a list of all users."
            }
        ]
    }
})

That's it! Browse to /api to access the docs.

Swagpi creates a static file server at the path specified. It builds interactive docs based on the JSON.

Config file

You can include a JSON path to a config file to keep the configuration separate:

swagpi(app, {
    path: '/api',
    logo: './logo.png',
    config: './config.json'
})

Package Sidebar

Install

npm i swagpi

Weekly Downloads

5

Version

0.1.1

License

MIT

Last publish

Collaborators

  • dthree