-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
43 lines (29 loc) · 883 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
37
38
39
40
41
42
43
const express = require("express");
const mysql = require("mysql");
const doenv = require("dotenv");
const path = require("path");
const hbs = require("hbs");
const cookieParser = require("cookie-parser");
const app = express();
doenv.config({
path: "./.env",
});
// db.connect((err) => {
// if(err){
// console.log(err);
// }else{
// console.log('MySQL Connection Success');
// }
// });
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
const location = path.join(__dirname, "./public");
app.use(express.static(location));
app.set("view engine", "hbs");
const partialsPath = path.join(__dirname, "./views/partials");
hbs.registerPartials(partialsPath);
app.use("/",require("./routes/pages"));
app.use("/auth",require("./routes/auth"));
app.listen(5000, ()=>{
console.log("Server Started @ Port 5000");
});