index.js
const Koa = require("koa");
const Router = require("koa-router");
const app = new Koa();
const router = new Router();
router.get("/", (ctx) => {
ctx.body = "index.html";
});
router.get("/404", (ctx) => {
ctx.body = "404 Not Found.";
});
app.use(router.routes()).use(router.allowedMethods());
app.listen(3000);