-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (25 loc) · 834 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
const express = require('express');
//for front-end and back-end at the same IP
const cors = require('cors');
const db = require('./db.js');
//for password encryption
const bcrypt = require('bcrypt');
const saltRounds = 10;
//for authentification
const jwt= require('jsonwebtoken');
//my functions
const admin = require("./admin/admin.js");
const welcome = require("./welcome/welcome.js");
const content = require("./content/content.js");
const app = express();
//the purpose of this??
app.use(express.json());
//for local use only
app.use(cors());
//for checking through POSTMAN on localhost
app.listen(3000, () => {
console.log("we're on 3000");
})
admin(app,db); //for admin use only
welcome(app,db,bcrypt,saltRounds,jwt); //for the welcome home page
content(app,db,bcrypt,saltRounds,jwt); //for the actual content page