Skip to content

Instantly share code, notes, and snippets.

@Horaddrim
Created August 11, 2017 19:59
Show Gist options
  • Save Horaddrim/c857ef4146d7ae9f338add907b2e11f9 to your computer and use it in GitHub Desktop.
Save Horaddrim/c857ef4146d7ae9f338add907b2e11f9 to your computer and use it in GitHub Desktop.
:D
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