Skip to content

Instantly share code, notes, and snippets.

@kluu1
Last active March 30, 2020 19:24
Show Gist options
  • Select an option

  • Save kluu1/f4a57a749aa289e56e8383045e9d5deb to your computer and use it in GitHub Desktop.

Select an option

Save kluu1/f4a57a749aa289e56e8383045e9d5deb to your computer and use it in GitHub Desktop.
const express = require('express');
const mongoose = require('mongoose');
const bodyParser = require('body-parser');
const keys = require('./configs/keys');
require('./models/Article');
require('./utils/redis');
const app = express();
const port = process.env.PORT || 3000;
app.use(bodyParser.json());
mongoose.connect(keys.MONGO_URI, {
useUnifiedTopology: true,
useNewUrlParser: true
});
require('./routes/articles')(app);
app.listen(port, () => console.log(`app is listening on port ${port}!`));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment