@get-enlace/nest
v0.0.9
Published
NestJS adapter for Enlace — an interactive visual execution graph for OpenAPI 3.x APIs.
Readme
@get-enlace/nest
NestJS adapter for Enlace — an interactive visual execution graph for any OpenAPI 3.x API.
This adapter's job is intentionally small: it serves the OpenAPI document and the @get-enlace/ui static bundle. Everything else (wiring up a chain, concurrent execution, credentials) happens client-side in the browser. Full documentation: get-enlace.github.io.
Install
npm install @get-enlace/nestUsage
With @nestjs/swagger (generated spec)
// app.module.ts — just import, no config needed
import { EnlaceModule } from '@get-enlace/nest';
@Module({ imports: [EnlaceModule] })
export class AppModule {}
// main.ts — one line after the app is built
const app = await NestFactory.create(AppModule);
const doc = SwaggerModule.createDocument(app, config);
EnlaceModule.setSpec(app, doc);With a static spec (file path or pre-parsed object)
@Module({ imports: [EnlaceModule.forRoot({ spec: './openapi.json' })] })
export class AppModule {}spec accepts a file path, a URL, or an already-parsed OpenAPI 3.x object.
Custom mount path
By default the canvas is at /enlace. To change it:
@Module({ imports: [EnlaceModule.forRoot({ path: 'canvas' })] })
export class AppModule {}Learn more
See the enlace-js repo for the other adapters in
this family, and the enlace repo for how Enlace
itself works.
