@get-enlace/express
v0.0.9
Published
Express adapter for Enlace — an interactive visual execution graph for OpenAPI 3.x APIs.
Readme
@get-enlace/express
Express 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/expressUsage
import { enlace } from '@get-enlace/express';
app.use('/enlace', enlace({ spec: './openapi.json' }));spec is a file path, a URL, or an already-parsed OpenAPI 3.x object — whatever's easiest to
point at your API's own document.
Using an existing spec setup
Already generating your OpenAPI document with swagger-jsdoc?
Call it yourself and pass the result straight through as spec — no separate export step:
import express from 'express';
import swaggerJsdoc from 'swagger-jsdoc';
import { enlace } from '@get-enlace/express';
const spec = swaggerJsdoc({
definition: {
openapi: '3.0.3',
info: { title: 'My API', version: '1.0.0' },
},
apis: ['./routes/*.js'],
});
app.use('/enlace', enlace({ spec }));swaggerJsdoc() runs synchronously with no server instance required, so this works before
app.listen(). Already mounting swagger-ui-express from the same document? Handing that same
object to enlace() too doesn't change how that keeps working — they're independent consumers of
the same spec.
Learn more
See the enlace-js repo for the other adapters in
this family, and the enlace repo for how Enlace
itself works.
