express-route-docs
v1.0.6
Published
Zero-config route documentation generator for Express.js APIs
Maintainers
Readme
📘 express-route-docs
Instantly document your Express routes with a clean and developer-friendly
/docspage.
🚀 Features
- 📄 Auto-generates a visual list of all your registered Express routes
- 🔍 Clean and copyable format for developers
- ⚙️ Works seamlessly in dev or production without hardcoding ports
- 🎨 Easy to customize CSS and layout
📦 Installation
npm install express-route-docs🔧 Usage
- Set up your Express server:
// index.js
const express = require("express");
const { setupRouteTracking, docsHandler } = require("express-route-docs");
const app = express();
// Track all routes dynamically
setupRouteTracking(app);
// Define your API routes
app.get("/", (req, res) => res.send("Welcome"));
app.post("/submit", (req, res) => res.send("Submitted"));
app.delete("/user", (req, res) => res.send("User deleted"));
// Serve docs
app.get("/docs", docsHandler);
// Start server
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log(`🚀 Docs available at http://localhost:${port}/docs`);
});- Optionally include CSS customization
You can override the default styles by placing a CSS file in a
publicdirectory.
📁 Folder Structure
project-root/
├── index.js
├── public/
│ └── style.css (optional)🧪 Example Output
Go to
http://localhost:3000/docsYou’ll see a clean, centered list of your routes, ideal for internal dev teams.
🧑💻 Author
Deepak Sarun Yuvachandran GitHub Portfolio
📄 License
This project is licensed under the MIT License.
