Chapter 6: code samples

This commit is contained in:
Beth Griggs
2020-05-30 19:33:25 +01:00
parent 4f825bdac3
commit b43bf2c378
398 changed files with 6049 additions and 53643 deletions
+22
View File
@@ -0,0 +1,22 @@
const Koa = require('koa');
const app = new Koa();
app.use(async (ctx, next) => {
console.log("First middleware start")
await next();
console.log("First middleware return")
});
app.use(async (ctx, next) => {
console.log("Second middleware start")
await next();
console.log("Second middleware return")
});
app.use(async ctx => {
console.log("Third middleware start");
console.log("Third middleware return");
});
app.listen(3000);