Last active
March 30, 2020 19:24
-
-
Save kluu1/f4a57a749aa289e56e8383045e9d5deb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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