feat(compression): Add cross-runtime response compression (Brotli/gzip), per-route decorators, and pre-compressed static file support
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import type { TypedRouter } from '@api.global/typedrequest';
|
||||
import type { ICompressionConfig } from '../compression/index.js';
|
||||
|
||||
// =============================================================================
|
||||
// HTTP Types
|
||||
@@ -272,6 +273,8 @@ export interface IStaticOptions {
|
||||
extensions?: string[];
|
||||
/** Enable directory listing */
|
||||
directoryListing?: boolean | IDirectoryListingOptions;
|
||||
/** Serve pre-compressed files (.br, .gz) when available */
|
||||
precompressed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -333,6 +336,8 @@ export interface ISmartServeOptions {
|
||||
keepAlive?: IKeepAliveConfig;
|
||||
/** Global error handler */
|
||||
onError?: (error: Error, request?: Request) => Response | Promise<Response>;
|
||||
/** Compression configuration (enabled by default) */
|
||||
compression?: ICompressionConfig | boolean;
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user