require('dotenv').config()

const config = require('src/config/index.js')
const { new: newCacheInstance } = require('src/utils/cache.js')
const app = require('./server.js')

async function runServer () {
  newCacheInstance()
  const server = app.listen(config.server.port, () => {
    // @ts-ignore
    console.info(`server start on port ${server.address().port}`)
  })
}

runServer()
