feat(typedserver): Remove legacy Express-based servertools, drop express deps, and refactor TypedServer to SmartServe + typedrouter with CORS support

This commit is contained in:
2025-12-04 17:12:52 +00:00
parent 722bf5d946
commit 065a253b3e
24 changed files with 55 additions and 1290 deletions

View File

@@ -1,7 +1,6 @@
import * as interfaces from '../../dist_ts_interfaces/index.js';
import { type IServerOptions, TypedServer } from '../classes.typedserver.js';
import * as plugins from '../plugins.js';
import * as servertools from '../servertools/index.js';
export interface IUtilityWebsiteServerConstructorOptions {
addCustomRoutes?: (typedserver: TypedServer) => Promise<any>;
@@ -59,10 +58,12 @@ export class UtilityWebsiteServer {
appSemVer: this.options.appSemVer || 'x.x.x',
};
// -> /lsw* - anything regarding serviceworker
servertools.serviceworker.addServiceWorkerRoute(this.typedserver, () => {
return lswData;
});
// -> Service worker version info handler
this.typedserver.typedrouter.addTypedHandler<interfaces.serviceworker.IRequest_Serviceworker_Backend_VersionInfo>(
new plugins.typedrequest.TypedHandler('serviceworker_versionInfo', async () => {
return lswData;
})
);
// ads.txt handler
this.typedserver.addRoute('/ads.txt', 'GET', async () => {