Answer the question
In order to leave comments, you need to log in
How to get data from export?
There are two files, here is the desired content:
import 'module-alias/register'
import 'source-map-support/register'
import runApp from '@/helpers/runApp'
import router from '@/helpers/runApp'
import runMongo from '@/helpers/mongo'
void (async () => {
await runMongo()
console.log('Mongo connected')
await runApp()
})()
export default async function () {
const router = new Router()
await bootstrapControllers({
app,
router,
basePath: '/',
controllers: [resolve(__dirname, '../controllers/*')],
disableVersioning: true,
})
app.use(cors({ origin: '*' }))
app.use(bodyParser())
app.use(router.routes())
app.use(router.allowedMethods())
return new Promise<Server>((resolve, reject) => {
const connection = app
.listen(env.PORT)
.on('listening', () => {
console.log(`HTTP is listening on ${env.PORT}`)
resolve(connection)
})
.on('error', reject)
})
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question