Created
June 7, 2017 13:49
-
-
Save SergProduction/3749501a9fff218e49ad609025f6bae1 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 app = new Koa(); | |
const router = require('koa-router')(); | |
router.get('/', async (ctx, next) { | |
const result = await new Promise( resolve => { | |
setTimeout(() => {resolve('YES!!!') }, 500) | |
}) | |
ctx.body = result | |
}); | |
app.use(routes.routes()); | |
app.use(routes.allowedMethods()); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment