2.0.1 • Published 4 years ago

@swagger-dir/core v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

@swagger-dir/core

A Swagger.io Directory Browser

Please read the documentation on the official site: https://github.com/VdustR/swagger-dir/tree/master/packages/core

More info

Install

npm i @swagger-dir/core
// or use yarn
yarn add @swagger-dir/core

Usage

const app = express();
const SwaggerDir = require('@swagger-dir/core');
const swaggerDir = new SwaggerDir(dir, options);
swaggerDir.start();

app.use(swaggerDir.fn);
app.use('subPath', swaggerDir.fn);

const server = app.listen(port);

const close = async () => {
  console.log('Service is closing...');
  await Promise.all([server.close(), swaggerDir.stop()]);
  console.log('Service is closed!');
};

Or you can check how the Swagger DIR CLI works for reference.

Options

const options = {
  mode = 'production',
  logLevel, // debug: 0, info: 1, warn: 2, error: 3, none: 4. Default: info
  formatDate, // Default: date => date.toISOString()
  swaggerUiOptions = {},
  id, // id for log
}
2.0.1

4 years ago

2.0.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.2

4 years ago

0.2.0

4 years ago

0.1.7

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago