Skip to content

📘 ReDoc frontend for you NestJS swagger API documentation

License

Notifications You must be signed in to change notification settings

cosys-work/nestjs-redoc

Repository files navigation

NestJS-Redoc

ReDoc powered frontend for your NestJS API spec


FeaturesHow to useChangelog

⚡ This is a ReDoc powered frontend for your NestJS API spec. By using ReDoc you improve your documentation presentation using a better UI/UX design

⚡ Features

TBD

Installation

Using npm: npm i nestjs-redoc

Using yarn: yarn add nestjs-redoc

❓ How to use

You need to install the Swagger module first if you want to get definitions, otherwise you may use a URL parameter for an OpenAPI definition instead of document object.

const options = new DocumentBuilder()
  .setTitle('Look, i have a title')
  .setDescription('A very nice description')
  .setBasePath('/api/v1')
  .build();
const document = SwaggerModule.createDocument(app, options);

Then add the followring example code.

Note: All properties are optional, if you don't specify a title we will fallback to the one you used above.

const redocOptions: RedocOptions = {
  title: 'Hello Nest',
  logo: {
    url: 'https://redocly.github.io/redoc/petstore-logo.png',
    backgroundColor: '#F0F0F0',
    altText: 'PetStore logo'
  },
  sortPropsAlphabetically: true,
  hideDownloadButton: false,
  hideHostname: false
};
// Instead of using SwaggerModule.setup() you call this module
RedocModule.setup('/docs', app, document, redocOptions);

📋 ToDo

bla bla

About

📘 ReDoc frontend for you NestJS swagger API documentation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 89.8%
  • Handlebars 5.7%
  • JavaScript 4.5%