typescriptexport {
Application,
Router,
} from "https://deno.land/x/oak@v6.3.1/mod.ts";
const app = new Application();
const router = new Router({ prefix: "/api" });
router.get("/feeds", (ctx) => getFeeds(ctx));
router.post("/feeds", (ctx) => addFeed(ctx));
app.use(router.routes());
app.use(router.allowedMethods());
const port = 3000;
await app.listen({ port });
typescriptconst body = await ctx.request.body();
ctx.assert(body.type === "json", 400); // 一つ目の引数が`false`なら400エラーを返却します