0.1.1 • Published 8 years ago
swagpi v0.1.1
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'
})