Last active
March 24, 2019 00:23
-
-
Save lamecksilva/bfc70dd0a5370224a1b7d8bd2c9900b6 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
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
app.use(bodyParser.json()); | |
mongoose | |
.connect('mongodb://db:27017/crud-node-mongo-docker', { | |
useNewUrlParser: true | |
}) | |
.then(result => { | |
console.log('MongoDB Conectado'); | |
}) | |
.catch(error => { | |
console.log(error); | |
}); | |
app.listen(9000, () => console.log('Server ativo na porta 9000')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment