-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
38 lines (28 loc) · 822 Bytes
/
server.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
37
const express=require('express');
const bodyParser=require("body-parser");
const path=require("path");
const http=require("http");
//import user files
const CONFIG=require("./configs.js");
//initialize server
const app=express();
const Server=http.Server(app);
//middlewares
//Serve Static Files
app.use(express.static(__dirname+ "/public_html/"));
//user data
app.use(express.json());
app.use(express.urlencoded({
extended:true
}));
//set view engine
app.set("view engine","ejs");
//routes
app.use("/customerDecided",require("./routes/CustomerDecided"));
app.use("/adminDecided",require("./routes/AdminDecided"));
app.get('/',(req,res)=>{
res.render("index");
});
app.listen(CONFIG.SERVER.PORT,function () {
console.log(`Server started at: http://${CONFIG.SERVER.HOST}:${CONFIG.SERVER.PORT} `);
});