Page MenuHomeSealhub

post.ts
No OneTemporary

export async function postTemplate(action_name: string): Promise<string> {
return `import { Context } from "koa";
import { Mountable } from "@sealcode/sealgen";
import Router from "@koa/router";
export const actionName = "${action_name}";
export default new (class ${action_name}Redirect extends Mountable {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async canAccess(_: Context) {
return { canAccess: true, message: "" };
}
mount(router: Router, path: string) {
router.get(path, async (ctx) => {
ctx.status = 302;
ctx.redirect("/new_url");
});
}
})();
`;
}

File Metadata

Mime Type
text/x-java
Expires
Tue, Dec 24, 14:05 (42 m, 39 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557327
Default Alt Text
post.ts (597 B)

Event Timeline