Nodejs Swagger 2.0 No operations defined in spec! on dist

Viewed 188

I defined the swagger option below:

const swaggerDocOptions = {   explorer: true,   definition: {
    swagger: '2.0',
    components: {},
    info: {
      title: 'Document API',
      version: '1.0.0',
      description: 'document API',
    },
    schemes: [
      'http',
      'https',
    ],
    security: [{
      simple: [],
    }],
    securityDefinitions: {
      simple: {
        type: 'basic',
      },
    },   },   basedir: `${__dirname}`,   apis: [
    `${__dirname}\\routes\\*.js`,   ], };

const specs = swaggerJsDoc(swaggerDocOptions);
 app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(specs));

The Api doc can display successfully when I run on my local enter image description here

And then I try to deploy to server with bytenote and the __dirname = app/dist on server, but the Api doc does not display enter image description here

Could you advise, what is wrong here?

0 Answers
Related