swagman-ui-express
v0.9.0
Published
Library to get a Swagman Web application into Express
Maintainers
Readme
Swagman UI Express
A simple library to serve "Swagman Web" in Express applications.

🚀 Install
npm install swagman-ui-express📖 Basic Usage
const express = require("express");
const swagmanUI = require("swagman-ui-express");
const app = express();
// Your OpenAPI/Swagger specification
const swaggerDoc = {
openapi: "3.0.0",
info: {
title: "My API",
version: "1.0.0",
},
paths: {
"/users": {
get: {
summary: "Get users",
responses: {
200: {
description: "List of users",
},
},
},
},
},
};
// Serve documentation at /api-docs
app.use("/api-docs", swagmanUI.serve, swagmanUI.setup(swaggerDoc));
app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
console.log("Documentation available at http://localhost:3000/api-docs");
});🔧 API
swagmanUI.serve
Static middleware to serve Swagman Web assets.
swagmanUI.setup(swaggerDoc, options)
Parameters:
swaggerDoc(Object) - Your OpenAPI/Swagger specification objectoptions.title(string, optional) - Custom page title (default: uses "Swagman Web")
Returns: Express middleware function
📝 License
MIT © NahueTomas
