Features • How to use • Changelog •
⚡ 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
TBD
Using npm: npm i nestjs-redoc
Using yarn: yarn add nestjs-redoc
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);
bla bla