Last active
October 2, 2018 23:26
-
-
Save ozanmuyes/f434ecfd41f14b9c5b31bb17ef1c6c2f 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 Koa = require('koa'); | |
const mongoose = require('mongoose'); | |
// Excerpted from https://mongoosejs.com/docs/index.html | |
mongoose.connect('mongodb://localhost/test'); | |
var db = mongoose.connection; | |
db.on('error', console.error.bind(console, 'connection error:')); | |
db.once('open', function() { | |
// we're connected! | |
}); | |
// Excerpted from https://koajs.com/#application | |
const app = new Koa(); | |
app.use(async (ctx) => { | |
ctx.body = 'Hello World'; | |
}); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment