-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
36 lines (29 loc) · 961 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import express from 'express'
import multer from 'multer'
import cors from 'cors'
import './config/dotenv.config.js'
import { initializeFirebase } from './config/firebase.config.js'
import { wss } from './config/wss.config.js'
import authenticationRouter from './routers/authenticationRouter.js'
import eventRouter from './routers/eventRouter.js'
import attendanceRouter from './routers/attendanceRouter.js'
import statusRouter from './routers/statusRouter.js'
import wishlistRouter from './routers/wishlistRouter.js'
initializeFirebase()
const app = express()
app.use(
express.json(),
multer().array(),
cors({
origin: process.env.CLIENT
}),
authenticationRouter,
eventRouter,
attendanceRouter,
statusRouter,
wishlistRouter
)
const server = app.listen(process.env.SERVER, () => {
console.log('server running on port', server.address().port)
console.log('socket running on port', wss.address().port)
})