Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22396953
post.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
581 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.post(path, async (ctx) => {
ctx.body = { message: "OK!" }
});
}
})();
`
;
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 17:01 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1199806
Default Alt Text
post.ts (581 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline