Skip to content

Instantly share code, notes, and snippets.

View eliabeleal's full-sized avatar
🎯
Focusing

Eliabe Leal eliabeleal

🎯
Focusing
View GitHub Profile
@eliabeleal
eliabeleal / server.js
Last active August 19, 2019 12:13
Conectando PostgreSQL (Sequelize) e MongoDB em uma mesma aplicação Node.js
const express = require('express')
const mongoose = require('mongoose')
const routes = require('./routes')
const server = express();
mongoose.connect('mongodb://localhost/mydb', { useNewUrlParser: true })
server.use(express.json())
server.listen(3333);
const express = require('express')
const LocationController = require('./controllers/LocationController')
const UserController = require('./controllers/UserController')
const routes = express.Router()
routes.post('/users', UserController.store)
module.exports = routes