Skip to content

Commit

Permalink
port
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya-Thakur committed May 30, 2021
1 parent cf033ab commit 442a9b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ const surveyController = require('./controllers/surveyController');
const responseController = require('./controllers/responseController');
var app = express();
app.use(bodyParser.json())
app.listen(3000, () => {
const port = process.env.PORT || 3000;
app.listen(port, () => {
console.log('Express server started at port: 3000');
});
app.use(cors());
app.use('/user', userController);
app.use('/survey', surveyController);
app.use('/response', responseController);
app.get('/', (req, res) => res.send('Home Page Route'));
14 changes: 13 additions & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@
"version": 2,
"env": {
"MONGODB_URI": "@my-mongodb-uri"
}
},
"builds": [
{
"src": "./server.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/"
}
]
}

1 comment on commit 442a9b7

@vercel
Copy link

@vercel vercel bot commented on 442a9b7 May 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.