Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996587
post.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
597 B
Referenced Files
None
Subscribers
None
post.ts
View Options
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
Details
Attached
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)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment