feat(controller): Add SW-TypedRequest controller for service worker communication

This commit is contained in:
2025-12-04 21:04:33 +00:00
parent e1310269fe
commit 6308e0126d
3 changed files with 51 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import * as paths from './paths.js';
import * as interfaces from '../dist_ts_interfaces/index.js';
import { DevToolsController } from './controllers/controller.devtools.js';
import { TypedRequestController } from './controllers/controller.typedrequest.js';
import { SwTypedRequestController } from './controllers/controller.swtypedrequest.js';
import { BuiltInRoutesController } from './controllers/controller.builtin.js';
export interface IServerOptions {
@@ -95,6 +96,7 @@ export class TypedServer {
// Decorated controllers
private devToolsController: DevToolsController;
private typedRequestController: TypedRequestController;
private swTypedRequestController: SwTypedRequestController;
private builtInRoutesController: BuiltInRoutesController;
// File server for static files
@@ -220,6 +222,7 @@ export class TypedServer {
}
this.typedRequestController = new TypedRequestController(this.typedrouter);
this.swTypedRequestController = new SwTypedRequestController(this.typedrouter);
this.builtInRoutesController = new BuiltInRoutesController({
domain: this.options.domain,
@@ -239,6 +242,7 @@ export class TypedServer {
plugins.smartserve.ControllerRegistry.registerInstance(this.devToolsController);
}
plugins.smartserve.ControllerRegistry.registerInstance(this.typedRequestController);
plugins.smartserve.ControllerRegistry.registerInstance(this.swTypedRequestController);
plugins.smartserve.ControllerRegistry.registerInstance(this.builtInRoutesController);
// Compile routes for fast matching