Chapter 6: code samples
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
const router = require("@koa/router")();
|
||||
|
||||
router.get("/", async function (ctx, next) {
|
||||
ctx.state = {
|
||||
title: "Koa.js",
|
||||
};
|
||||
await ctx.render("index");
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user