next/server/middleware/20.cidx.ts

8 lines
265 B
TypeScript
Raw Normal View History

import { log } from "@server/logger";
export default eventHandler((ev) => {
let chapParam = getRouterParams(ev).chapter;
log.silly(JSON.stringify(getRouterParams(ev)), { label: "sigh" });
ev.context.chapterIndex = !!chapParam ? parseInt(chapParam) - 1 : 0;
});