@gorvok/docs
v1.0.2
Published
User Signup API Docs
Downloads
4
Readme
- Easy integration with Express applications
- Serves Swagger UI documentation at a specified route
- Supports Swagger JSON configurations
npm install @gorvok/docs
1. Import the package First, require '@gorvok/docs' in your Express app:
const setupDocs = require('@gorvok/docs');
2. Initialize Swagger UI Documentation Use the imported function to add Swagger UI documentation to your application. Typically, you'd do this after setting up your middleware but before defining any routes:
const express = require('express');
const app = express();
// Setup Swagger documentation
setupDocs(app);
// Your routes here
app.get('/', (req, res) => res.send('Hello World!'));
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`Listening on port ${port}...`));
By default, the documentation will be served at /api-docs.