fix(servertools): Adjust route wildcard patterns and CORS handling; update serviceworker and SSL redirect patterns; bump express dependency; add local Claude settings

This commit is contained in:
2025-08-17 12:49:28 +00:00
parent 9477eac268
commit a0f714a561
9 changed files with 19 additions and 9 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedserver',
version: '3.0.76',
version: '3.0.77',
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
}

View File

@@ -146,7 +146,7 @@ export class TypedServer {
if (this.options.serveDir) {
this.server.addRoute(
'/*',
'/*splat',
new servertools.HandlerStatic(this.options.serveDir, {
responseModifier: async (responseArg) => {
if (plugins.path.parse(responseArg.path).ext === '.html') {

View File

@@ -132,7 +132,7 @@ export class Server {
});
this.expressAppInstance.use(cors);
this.expressAppInstance.options('/*', cors);
this.expressAppInstance.options('/*splat', cors);
}
this.expressAppInstance.use((req, res, next) => {

View File

@@ -38,7 +38,7 @@ export const addServiceWorkerRoute = (
swVersionInfo = swDataFunc();
// the basic stuff
typedserverInstance.server.addRoute('/serviceworker.*', serviceworkerHandler);
typedserverInstance.server.addRoute('/serviceworker{.*}', serviceworkerHandler);
// the typed stuff
const typedrouter = new plugins.typedrequest.TypedRouter();

View File

@@ -10,7 +10,7 @@ export const redirectFrom80To443 = async () => {
});
smartexpressInstance.addRoute(
'*',
'/*splat',
new Handler('ALL', async (req, res) => {
res.redirect('https://' + req.headers.host + req.url);
})