const swaggerAutogen = require('swagger-autogen')(); const outputFile = './swagger.json'; const endpointsFiles = ['./api/routes.js'] swaggerAutogen(outputFile, endpointsFiles).then(() => { require('./server.js') })