-
-
Save amandeepmittal/77c129ff88f04d5951b8e06fd7e308bc 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 PORT = process.env.PORT || 5000; | |
// configure body parser for AJAX requests | |
app.use(express.urlencoded({ extended: true })); | |
app.use(express.json()); | |
// routes | |
app.get('/', (req, res) => { | |
res.send('Hello from MERN'); | |
}); | |
// 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