-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
25 lines (22 loc) · 814 Bytes
/
index.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
//requirements and imports
const express = require("express");
const bodyParser = require("body-parser");
const path = require("path");
const cookieParser = require("cookie-parser");
require("dotenv").config();
var app = express();
//midlewares
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, "ui")));
app.use(express.static(path.join(__dirname, "views")));
app.use(cookieParser());
//routes
app.use("/", require("./server/routes/loginSignupRouter"));
app.use("/chat", require("./server/routes/chatRouter"));
app.use("/profile", require("./server/routes/profileRouter"));
app.use("/home", require("./server/routes/homeRouter"));
//app listening
const port = process.env.PORT || 5000;
app.listen(port, () => {
console.log(`server started at port ${port}`);
});