0.0.3 • Published 6 years ago

express-dot-doc v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

express-dot-doc

Is your Express API documentation always out of date?

Usage

import express from 'express'
import expressDoc from 'express-dot-doc'

const app = express()
app.get('/ducks', () => {})
app.get('/pandas', () => {})
const opts = {path: '/api-documentation'}
expressDoc(app, opts)

app.listen(6505)

and go to http://localhost:6505/api-documentation

Opts

PropertyExplanation
pathDocumentation api path. Defaults to /api-documentation

How

Library uses app._router.stack to find routes registered to express server. This is the reason why you need to add expressDoc(app) after your routes.

Random thoughts

React is probably a bit heavy tool for rendering the response..!