This commit is contained in:
@@ -36,6 +36,7 @@ export class OpsServer {
|
||||
domain: 'localhost',
|
||||
feedMetadata: undefined,
|
||||
bundledContent: bundledFiles,
|
||||
addCustomRoutes: async (typedserver) => this.registerCustomRoutes(typedserver),
|
||||
});
|
||||
|
||||
// Chain typedrouters: server -> opsServer -> individual handlers
|
||||
@@ -43,7 +44,6 @@ export class OpsServer {
|
||||
|
||||
// Set up all handlers
|
||||
await this.setupHandlers();
|
||||
this.registerCustomRoutes();
|
||||
|
||||
await this.server.start(port);
|
||||
logger.success(`OpsServer started on http://localhost:${port}`);
|
||||
@@ -73,18 +73,18 @@ export class OpsServer {
|
||||
logger.success('OpsServer TypedRequest handlers initialized');
|
||||
}
|
||||
|
||||
private registerCustomRoutes(): void {
|
||||
this.server.typedserver.addRoute(
|
||||
private registerCustomRoutes(typedserver: plugins.typedserver.TypedServer): void {
|
||||
typedserver.addRoute(
|
||||
'/v2',
|
||||
'ALL',
|
||||
async (ctx) => this.oneboxRef.registry.handleRequest(ctx.request),
|
||||
);
|
||||
this.server.typedserver.addRoute(
|
||||
typedserver.addRoute(
|
||||
'/v2/*',
|
||||
'ALL',
|
||||
async (ctx) => this.oneboxRef.registry.handleRequest(ctx.request),
|
||||
);
|
||||
this.server.typedserver.addRoute(
|
||||
typedserver.addRoute(
|
||||
'/backups/:backupId/download',
|
||||
'GET',
|
||||
async (ctx) => {
|
||||
|
||||
Reference in New Issue
Block a user