Package Exports
- @vsaas/loopback-component-explorer
- @vsaas/loopback-component-explorer/lib/url-join
- @vsaas/loopback-component-explorer/package.json
Readme
LoopBack Component Explorer
@vsaas/loopback-component-explorer is a maintained fork of
loopback-component-explorer for LoopBack 3 applications.
This fork modernizes the package while preserving the familiar explorer API:
- TypeScript source in
src/ - build output in
dist/ - OpenAPI 3 documents generated through
@vsaas/loopback-swagger - Swagger UI 5 static assets served from
dist/public vitest,oxlint,oxfmt, andtsdown- English-only runtime messages without
strong-globalizeorintl/
Installation
npm install @vsaas/loopback-component-explorerUsage
const loopback = require('@vsaas/loopback');
const explorer = require('@vsaas/loopback-component-explorer');
const app = loopback();
app.use('/api', loopback.rest());
explorer(app, {
mountPath: '/explorer',
});This mounts:
/explorer/for the Swagger UI frontend/explorer/config.jsonfor the UI config payload/explorer/swagger.jsonfor the generated OpenAPI document
You can also mount the middleware directly:
app.use('/explorer', explorer.routes(app, { mountPath: '/explorer' }));Scope
This package currently supports:
- explorer UI mounting via
explorer(app, options) - middleware-only mounting via
explorer.routes(app, options) - dynamic spec rebuilds when models or remote methods are added, removed, or disabled
- UI overrides via
uiDirs - API specs generated by
@vsaas/loopback-swagger
The explorer serves swagger.json for backward-compatible URLs, but the
document content is OpenAPI 3.
Options
Common options:
mountPathDefault:"/explorer"resourcePathDefault:"swagger.json"swaggerUIDefault:trueuiDirsString or array of override directories loaded before built-in assetsapiInfoExtra metadata forwarded to the generated OpenAPI documenthostOptional host override for the generated specprotocolOptional protocol override for the generated specauthOptional frontend auth config exposed byconfig.json
Notes for Fork Users
- This is a fork, not the upstream
loopback-component-explorerpackage. - The package name is
@vsaas/loopback-component-explorer. - Runtime code is published from
dist/. - Test files remain plain
.js.
Development
npm run build
npm run typecheck
npm run lint
npm testLicense
MIT. See LICENSE.