Deploy: DocfyUiModule vs standalone
Serve it from the same NestJS app that exposes the API, or as a static bundle on any static host.
Installation
npm install docfy-uiThis package ships a pre-built static bundle (dist/): there's no server-side code to install on a Node backend. If you're using nestjs-docfy, its DocfyUiModule.setup() already wraps this for you; otherwise, serve the dist/ folder with any static file server.
Via DocfyUiModule.setup()
The simplest setup if your backend is NestJS: let nestjs-docfy mount this package for you.
import { NestFactory } from "@nestjs/core";
import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";
import { DocfyUiModule } from "nestjs-docfy";
const app = await NestFactory.create(AppModule);
DocfyUiModule.setup("/docs", app); // before SwaggerModule.setup
const document = SwaggerModule.createDocument(app, new DocumentBuilder().build());
SwaggerModule.setup("api", app, document); // exposes /api-json, which docfy-ui fetches by default
await app.listen(3000);Visit /docs: no additional configuration needed.
Standalone (static)
Without nestjs-docfy, build and serve the static assets yourself and point it at any OpenAPI document:
npm run build # in this package, or use the prebuilt dist/ from npmServe dist/ with any static host (NestJS's ServeStaticModule, Nginx, S3 + CloudFront, etc.), alongside or in front of the API that exposes the spec.
Pointing to a remote spec
If the spec lives on a different origin, use the ?spec=<url> override (see Configuration).