-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
35 lines (30 loc) · 977 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
require('dotenv').config()
const mongoose = require('mongoose');
const express = require('express');
const app = express();
// dotenv.config({path: './config.env'});
require('./db/conn');
app.use(express.json())
// const User = require('./model/userSchema');
app.use(require('./router/auth'))
const PORT = process.env.PORT || 5000;
console.log("port = ",PORT)
// app.get('/about', (req, res)=>{
// res.send("Welcome to the about page")
// })
// app.get('/contact', (req, res)=>{
// res.cookie("Testc", "You are hot and amazing")
// res.send("Welcome to the contact page")
// })
// app.get('/signin', (req, res)=>{
// res.send("Welcome to the signin page")
// })
// app.get('/signup', (req, res)=>{
// res.send("Welcome to the signup page")
// })
if (process.env.NODE_ENV == "production") {
app.use(express.static("kgp-talks/build"));
}
app.listen(PORT, ()=>{
console.log(`Server running live at Localhost:${PORT} http://localhost:3000/`)
});