# koa-swagger-ui-plus

> SwagerUi 4.0 middleware for koa

Latest version **0.0.1** (published 2021-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install koa-swagger-ui-plus
pnpm add koa-swagger-ui-plus
yarn add koa-swagger-ui-plus
bun add koa-swagger-ui-plus
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-10-18 |
| First published | 2021-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 7.6.0 |
| Dependencies | 3 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wucf |
| Maintainers | wucf |
| Keywords | koa, middleware, swagger-ui |

## Links

- npm: https://www.npmjs.com/package/koa-swagger-ui-plus
- Repository: https://github.com/wucf93/koa-swagger-ui-plus
- Homepage: https://github.com/wucf93/koa-swagger-ui-plus#readme
- Issues: https://github.com/wucf93/koa-swagger-ui-plus/issues
- npm.io page: https://npm.io/package/koa-swagger-ui-plus

## Dependencies (3)

- [koa-mount](https://npm.io/package/koa-mount.md) ^4.0.0
- [koa-static](https://npm.io/package/koa-static.md) ^5.0.0
- [swagger-ui-dist](https://npm.io/package/swagger-ui-dist.md) ^4.0.0-rc.4

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2021-10-18

## README

# koa-swagger-ui-plus

SwagerUi 4.0 middleware for koa

## Installation

```bash
$ npm install koa-swagger-ui-plus
```

## API

```js
const Koa = require("koa");
const app = new Koa();
app.use(
  require("koa-swagger-ui-plus")({
    url: "https://petstore.swagger.io/v2/swagger.json",
  })
);
```

### Options

- `routePrefix` route where the view is returned,must begin with "/", (defaults to "/docs")
- `gzip` Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested file with .gz extension exists. (defaults to true).
- `url` The URL pointing to API definition (normally swagger.json or swagger.yaml). Will be ignored if urls or spec is used
- `urls` If true, serves after `return next()`, allowing any downstream middleware to respond first.
- `spec` A JavaScript object describing the OpenAPI definition. When used, the url parameter will not be parsed. This is useful for testing manually-generated definitions without hosting them

## Example

```js
const SwaggerUIPlus = require("koa-swagger-ui-plus");
const Koa = require("koa");
const app = new Koa();

app.use(
  SwaggerUIPlus({
    routePrefix: "/swagger",
    url: "https://petstore.swagger.io/v2/swagger.json",
  })
);

app.listen(3000);

// visit http://localhost:3000/swagger
console.log("listening on port 3000");
```

### See also

- [swagger-ui](http://github.com/swagger-api/swagger-ui) Swagger UI official documentation

## License

MIT

---
_Source: https://npm.io/package/koa-swagger-ui-plus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
