@ripple-ts/adapter 0.2.211 → 0.2.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +3 -0
- package/package.json +1 -1
- package/types/index.d.ts +17 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# @ripple-ts/adapter
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@ripple-ts/adapter)
|
|
4
|
+
[](https://www.npmjs.com/package/@ripple-ts/adapter)
|
|
5
|
+
|
|
3
6
|
Shared adapter primitives for Ripple metaframework adapters.
|
|
4
7
|
|
|
5
8
|
This package contains common runtime helpers and shared type contracts used by
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -6,6 +6,17 @@ export type FetchHandler<Platform = any, ResultValue = Response> = (
|
|
|
6
6
|
export type AdapterCoreOptions = {
|
|
7
7
|
port?: number;
|
|
8
8
|
hostname?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to trust `X-Forwarded-Proto` and `X-Forwarded-Host` headers
|
|
11
|
+
* when deriving the request origin (protocol + host).
|
|
12
|
+
*
|
|
13
|
+
* Enable this only when the application is behind a trusted reverse proxy
|
|
14
|
+
* (e.g., nginx, Cloudflare, AWS ALB). When `false` (the default), the
|
|
15
|
+
* protocol is inferred from the socket and the host from the `Host` header.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
trustProxy?: boolean;
|
|
9
20
|
};
|
|
10
21
|
|
|
11
22
|
export type ServeStaticOptions = {
|
|
@@ -29,6 +40,12 @@ export type ServeResult<Server = any> = {
|
|
|
29
40
|
close: () => void;
|
|
30
41
|
};
|
|
31
42
|
|
|
43
|
+
export type ServeFunction<
|
|
44
|
+
Platform = any,
|
|
45
|
+
Options extends AdapterCoreOptions = AdapterCoreOptions,
|
|
46
|
+
Server = any,
|
|
47
|
+
> = (fetch_handler: FetchHandler<Platform>, options?: Options) => ServeResult<Server>;
|
|
48
|
+
|
|
32
49
|
export const DEFAULT_HOSTNAME: 'localhost';
|
|
33
50
|
export const DEFAULT_PORT: 3000;
|
|
34
51
|
export const DEFAULT_STATIC_PREFIX: '/';
|