JSPM

@vsaas/loopback-component-explorer

11.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 82
  • Score
    100M100P100Q75689F
  • License MIT

Fork of LoopBack API Explorer component for serving Swagger UI with OpenAPI specs generated from LoopBack apps

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, and tsdown
  • English-only runtime messages without strong-globalize or intl/

Installation

npm install @vsaas/loopback-component-explorer

Usage

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.json for the UI config payload
  • /explorer/swagger.json for 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:

  • mountPath Default: "/explorer"
  • resourcePath Default: "swagger.json"
  • swaggerUI Default: true
  • uiDirs String or array of override directories loaded before built-in assets
  • apiInfo Extra metadata forwarded to the generated OpenAPI document
  • host Optional host override for the generated spec
  • protocol Optional protocol override for the generated spec
  • auth Optional frontend auth config exposed by config.json

Notes for Fork Users

  • This is a fork, not the upstream loopback-component-explorer package.
  • 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 test

License

MIT. See LICENSE.