-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
41 lines (36 loc) · 765 Bytes
/
index.js
File metadata and controls
41 lines (36 loc) · 765 Bytes
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 app = express();
const cors = require("cors");
require("dotenv").config();
const connection = require("./database/connection");
const PORT = 8080 || process.env.PORT;
//Connect To Database
connection();
//Middleware
app.use(express.json());
app.use(cors({ origin: "*" }));
app.disable("x-powered-by")// less Hackers know about your stack
//Route Middleware
require("./routes/routes")(app);
app.listen(PORT, function () {
console.log(`Server Running on http://localhost:${8080}`);
});
/*
Step we follow==>
model user schema
routes
auth
jwt
bcrypt
@hapi/joi
verification token
validation
middleware
public routes
private routes
register
login
name
email
password
*/