-
-
Save amandeepmittal/1ec2534f38c35561e2b88ffb5f0de15f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// server.js | |
const express = require('express'); | |
const app = express(); | |
const routes = require('./routes'); | |
const PORT = process.env.PORT || 5000; | |
// require db connection | |
require('./models'); | |
// configure body parser for AJAX requests | |
app.use(express.urlencoded({ extended: true })); | |
app.use(express.json()); | |
app.use(routes); | |
// Bootstrap server | |
app.listen(PORT, () => { | |
console.log(`Server listening on port ${PORT}.`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment