-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (21 loc) · 802 Bytes
/
Copy pathserver.js
File metadata and controls
26 lines (21 loc) · 802 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
const express = require('express');
const app =express();
const validator = require('express-validator');
const DBConnect =require('./config/dbconnector');
const authRoutes = require('./Routes/authRoutes');
const path = require('path');
const cookieParser = require("cookie-parser");
require('dotenv').config();
//Database Connection
DBConnect();
app.use(express.urlencoded({extended: false}));
app.use(express.json());
app.use(express.static(path.join(__dirname, 'public')));
app.use(cookieParser());
//app Routes
app.get('/api/health',(req,res)=> res.json({HealthStatus: 'Ok', message: 'Server is Up and Running!'}));
app.use('/api/auth', authRoutes);
// app.listen(process.env.PORT , ()=>{
// console.log(`Server is Up and running at PORT: ${process.env.PORT}`);
// });
export default app;