also looking at this
feat: imgx integration — on-the-fly image transforms from query params
#2264
15 files
+1118
-16
| @@ -14,7 +14,7 @@ | ||
| 14 | 14 | * - `id` is validated against a strict charset to keep it from escaping |
| 15 | 15 | * the registry directory. |
| 16 | 16 | */ |
| 17 | import type { BasicAuthConfig, LoadBalancerConfig, PathRewrite, ProxyFrom, StaticRouteConfig } from './types' | |
| 17 | import type { BasicAuthConfig, ImgxOptions, LoadBalancerConfig, PathRewrite, ProxyFrom, StaticRouteConfig } from './types' | |
| 18 | 18 | import * as fs from 'node:fs' |
| 19 | 19 | import * as fsp from 'node:fs/promises' |
| 20 | 20 | import { homedir } from 'node:os' |
| @@ -50,6 +50,8 @@ export interface RegistryEntry { | ||
| 50 | 50 | pathRewrites?: PathRewrite[] |
| 51 | 51 | cleanUrls?: boolean |
| 52 | 52 | changeOrigin?: boolean |
| 53 | /** Transform image responses from imgix-style query params — see {@link ImgxOptions}. */ | |
| 54 | imgx?: boolean | ImgxOptions | |
| 53 | 55 | /** Serve a local directory for this route instead of proxying. */ |
| 54 | 56 | static?: string | StaticRouteConfig |
| 55 | 57 | /** Optional HTTP Basic auth gate for this route. */ |
| @@ -300,6 +302,7 @@ export function watchRegistry( | ||
| 300 | 302 | pathRewrites: entry.pathRewrites, |
| 301 | 303 | cleanUrls: entry.cleanUrls, |
| 302 | 304 | changeOrigin: entry.changeOrigin, |
| 305 | imgx: entry.imgx, | |
| 303 | 306 | static: entry.static, |
| 304 | 307 | loadBalancer: entry.loadBalancer, |
| 305 | 308 | })) |