UNPKG

860 BMarkdownView Raw
1# Swagger UI Dist
2[![NPM version](https://badge.fury.io/js/swagger-ui-dist.svg)](http://badge.fury.io/js/swagger-ui-dist)
3
4# API
5
6This module, `swagger-ui-dist`, exposes Swagger-UI's entire dist folder as a dependency-free npm module.
7Use `swagger-ui` instead, if you'd like to have npm install dependencies for you.
8
9`SwaggerUIBundle` and `SwaggerUIStandalonePreset` can be imported:
10```javascript
11 import { SwaggerUIBundle, SwaggerUIStandalonePreset } from "swagger-ui-dist"
12```
13
14To get an absolute path to this directory for static file serving, use the exported `getAbsoluteFSPath` method:
15
16```javascript
17const swaggerUiAssetPath = require("swagger-ui-dist").getAbsoluteFSPath()
18
19// then instantiate server that serves files from the swaggerUiAssetPath
20```
21
22For anything else, check the [Swagger-UI](https://github.com/swagger-api/swagger-ui) repository.