In local, Swagger works perfectly well. However, when I deploy the production version on my remote machine, Swagger still shows up on my url / api-docs but throws the error "No operations defined in spec!" and no longer displays the routes, only the Schemas. I cannot identify the source of the error.
And I have this in Swagger configuration:
const swaggerOptions = {
swaggerDefinition: {
openapi: "3.0.0",
info: {
version: "1.0.0",
title: "Kourier API",
description: "Kourier API Documentation",
contact: {
name: "Amazing Developer"
},
},
servers: [
{url: "http://localhost:3000/"}
],
},
apis: [
"./Api/Models/Swagger/User.js",
"./Api/Models/Swagger/ResetPassword.js",
"./Api/routes/user/index.js",
"./Api/routes/reset-password/index.js",
"./Api/routes/template/index.js",
"./Api/Models/Swagger/Template.js",
"./Api/Models/Swagger/Preview.js"
]
};