i am deploying my node js backend on ubuntu ec2 machine but when it is deployed it gives the following error
at node:internal/main/run_main_module:22:47
2| Error: Explicit version indication is deprecated
2| at SwaggerTheme.getBuffer (/home/ubuntu/var/www/obenan-api-v20240731171044/node_modules/swagger-themes/build/swagger-theme.js:36:19)
2| at Object.<anonymous> (/home/ubuntu/var/www/obenan-api-v20240731171044/index.js:200:19)
2|o at Module._compile (node:internal/modules/cjs/loader:1198:14)
2| at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
2| at Module.load (node:internal/modules/cjs/loader:1076:32)
2|at Function.Module._load (node:internal/modules/cjs/loader:911:12)
2| at Object.<anonymous> (/home/ubuntu/.nvm/versions/node/v16.20.2/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
2| at Module._compile (node:internal/modules/cjs/loader:1198:14)
2| at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
2| at Module.load (node:internal/modules/cjs/loader:1076:32)
2| at Function.Module._load (node:internal/modules/cjs/loader:911:12)
2| at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
2| at node:internal/main/run_main_module:22:47
The code i am using for it is
const swaggerUi = require('swagger-ui-express');
const swagger = require('./swagger.json');
const { SwaggerTheme } = require('swagger-themes');
swagger.host = process.env.BACKEND_BASE_URL;
swagger.schemes = process.env.BACKEND_BASE_URL == 'localhost:4000' ? ['http'] : ['https'];
const theme = new SwaggerTheme('v3');
const options = {
explorer: true,
customCss: theme.getBuffer('dark'),
};
app.use('/swagger', swaggerUi.serve, swaggerUi.setup(swagger, options));
const port = config.port || 4000;
const server = app.listen(port, () => {
log(color.yellow(' ******************************************** '));
log(color.yellow(' ******* ******* '));
log(color.yellow(` ******* Server is running on ${port} ******* `));
log(color.yellow(' ******* ******* '));
log(color.yellow(' ******************************************** '));
});
i am expectiong to see server running on port in swagger ui. I am stuck in this