-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
29 lines (22 loc) · 835 Bytes
/
server.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
require("dotenv").config();
const ConnectionDB =require("./database");
const express = require("express");
const cors = require("cors");
const path = require("path");
const User = require('./models/user');
const helmet=require('helmet')
const Freelancer = require('./models/freelancer');
ConnectionDB();
const app = express()
const port = process.env.PORT || 5000
app.use(cors())
app.use(express.json())
//Available Routes
app.use("/api/auth",require("./routes/auth"))
app.use("/api/freelancerauth",require("./routes/freelancerauth"))
app.use("/api/user",require("./routes/userdata"))
app.use("/api/userprofile",require("./routes/user/userprofile"))
app.use("/api/freelancerprofile",require("./routes/freelancer/freelancerprofile"))
app.listen(port, () => {
console.log(` backend listening at http://localhost:${port}`)
})