-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (22 loc) · 780 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
const express = require('express');
const bodyParser = require('body-parser')
const app = express();
const indexRoutes = require("./routes/index")
const config = require('config');
const globalErrorHandler = require("./error-handlers/global-error-handler")
const cors = require("cors");
const mongoose = require("./config/mongodb.config")
const firebaseAuthMiddleware = require("./config/firebase.config")
let hostConfig = config.get('appConfig.hostConfig');
const PORT = hostConfig.port || 3600;
app.use(bodyParser.json())
app.use(cors())
app.use(firebaseAuthMiddleware)
app.use(indexRoutes)
app.get("/", (req, res, next) => {
res.send("Hello User");
})
app.use(globalErrorHandler)
app.listen(PORT, () => {
console.log("App server is started at port " + PORT)
})