Created
August 11, 2017 19:59
-
-
Save Horaddrim/c857ef4146d7ae9f338add907b2e11f9 to your computer and use it in GitHub Desktop.
:D
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 Patios = require('./models/Patios'); | |
const patiosSchema = require('./models/patiosSchema'); | |
const express = require('express'); | |
const app = express(); | |
const mongoose = require('mongoose'); | |
mongoose.Promise = require('bluebird'); | |
mongoose.connect('mongodb://mongo/verithus'); | |
app.get('/Patios', function(req,res) | |
{ | |
patiosSchema.find({}).then(eachOne => | |
{ | |
res.json(eachOne); | |
}) | |
}); | |
app.listen(8165, function () | |
{ | |
console.log("Servidor funcionando!") | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment