mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-11-28 17:41:15 +00:00
17 lines
436 B
TypeScript
17 lines
436 B
TypeScript
import app from './app'
|
|
import { createServer } from 'http'
|
|
import logger from 'helpers/logger'
|
|
import createSocketIOInstance from './socket'
|
|
|
|
const server = createServer(app)
|
|
const io = createSocketIOInstance(server)
|
|
|
|
app.use((req, res, next) => {
|
|
// @ts-expect-error TODO: add io type
|
|
req.io = io
|
|
next()
|
|
})
|
|
|
|
server.listen(process.env.SERVER_PORT, () => {
|
|
logger.info(`Server is running @ ${process.env.SERVER_PORT ?? ''}`)
|
|
})
|