mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-23 22:15:49 +00:00
feat(pockethost): Cron-based webhooks
This commit is contained in:
parent
d5e850041e
commit
42d2085f69
@ -9,6 +9,9 @@ routerAdd("POST", "/api/instance", (c) => {
|
||||
routerAdd("DELETE", "/api/instance/:id", (c) => {
|
||||
return require(`${__hooks}/mothership`).HandleInstanceDelete(c);
|
||||
}, $apis.requireRecordAuth());
|
||||
routerAdd("POST", "/api/instance/:id/webhook/test", (c) => {
|
||||
return require(`${__hooks}/mothership`).HandleInstanceWebhookTest(c);
|
||||
}, $apis.requireRecordAuth());
|
||||
routerAdd("GET", "/api/instance/resolve", (c) => {
|
||||
return require(`${__hooks}/mothership`).HandleInstanceResolve(c);
|
||||
}, $apis.requireAdminAuth());
|
||||
|
||||
@ -2,6 +2,7 @@ import {
|
||||
InstanceFields,
|
||||
InstanceId,
|
||||
LoggerService,
|
||||
LogLevelName,
|
||||
mkInstanceUrl,
|
||||
mkSingleton,
|
||||
MothershipAdminClientService,
|
||||
@ -16,6 +17,7 @@ export type CronServiceConfig = SingletonBaseConfig & {}
|
||||
export const CronService = mkSingleton(async (config: Partial<CronServiceConfig>) => {
|
||||
const mirror = await MothershipMirrorService()
|
||||
const logger = (config.logger ?? LoggerService()).create(`CronService`)
|
||||
logger.setLevel(LogLevelName.Debug)
|
||||
const { dbg, error, info, warn } = logger
|
||||
info(`Starting`)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user