-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
42 lines (26 loc) · 758 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
const express=require('express');
const bodyParser = require("body-parser");
const { setStatics } = require("./utils/statics");
const app = express();
// .ENV CONFIG
require('dotenv').config();
//Middlewares
app.use(express.json()); // Parse JSON request bodies
app.use(express.urlencoded({ extended: true }));
//End of middleware
//Statics
setStatics(app);
//EJS
app.set("view engine", "ejs");
app.set("views", "views");
//End of EJS
// Create Table Foriegn Key
require('./function/createTable').CreateTable();
app.use('/users',require('./routes/user'));
app.use('/ads',require('./routes/advertising'));
app.get('/admin',(req,res)=>{
res.render('index3');
});
app.listen(3000,async()=>{
console.log('Server is Runing on Port 3000');
});