swagger-stats icon indicating copy to clipboard operation
swagger-stats copied to clipboard

When will Nest.js be supported? Thank you very much!

Open gzg1500521074 opened this issue 3 years ago • 1 comments

I mainly use nest. Js framework in my daily work. I would like to ask when it can be supported.

gzg1500521074 avatar Apr 01 '22 10:04 gzg1500521074

You can already use it in NestJs by adding the following code to the main.ts file :

const swStats = require('swagger-stats');  
app.use(swStats.getMiddleware({ 
  swaggerSpec: document,
  authentication: true,
  onAuthenticate: function(req: any, username: string, password: string){
    // simple check for username and password
    return (
        username === 'username' &&
        password === 'password'
    );
  }
}));

sangimed avatar Apr 12 '22 09:04 sangimed