Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 3, 2018 04:35
Show Gist options
  • Save amandeepmittal/b71f46051ccfa732ed047c116f1c55af to your computer and use it in GitHub Desktop.
Save amandeepmittal/b71f46051ccfa732ed047c116f1c55af to your computer and use it in GitHub Desktop.
const express = require('express');
const app = express();
const PORT = 4000;
app.use(express.json());
app.use(
express.urlencoded({
extended: true
})
);
// app.get('/', (req, res) => {
// res.json({ message: 'REST API with Node.js, and Postgres API' });
// });
require('./routes/index')(app);
app.listen(PORT, () => {
console.log(`Server running at port ${PORT}.`);
});
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment