Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailesh93602 authored Jun 26, 2024
1 parent 6455e77 commit d4aac73
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const nodemailer = require('nodemailer');
require('dotenv').config();
// require("./db/conn");
// const Player = require("./models/players");
//give port number

const port = process.env.PORT || 3000;


Expand Down Expand Up @@ -63,10 +61,6 @@ app.use(bodyParser.urlencoded({ extended: false}));
mongoose.connect("mongodb+srv://shailesh93602:[email protected]/players");

var db = mongoose.connection;
//listen for requests
// app.listen(3000);
app.listen(port);
console.log(port);

app.get('/', (req, res) => {
res.render('index', { title: 'Home'});
Expand Down Expand Up @@ -396,5 +390,10 @@ app.post('/contactus', (req, res) => {
});
});

app.listen(port, () => {
console.log("Server is running on port: "+ port);
});



module.exports = app;

0 comments on commit d4aac73

Please sign in to comment.