( app: Hono, route: DevProxyRoute, path: string, fetchImpl: typeof globalThis.fetch, allowedOrigins: DevProxyCorsAllowedOrigins, )
| 210 | const normalizeRoutePaths = (paths: DevProxyRoute['paths']) => Array.isArray(paths) ? paths : [paths] |
| 211 | |
| 212 | const registerProxyRoute = ( |
| 213 | app: Hono, |
| 214 | route: DevProxyRoute, |
| 215 | path: string, |
| 216 | fetchImpl: typeof globalThis.fetch, |
| 217 | allowedOrigins: DevProxyCorsAllowedOrigins, |
| 218 | ) => { |
| 219 | if (!path.startsWith('/')) |
| 220 | throw new Error(`Invalid dev proxy route path "${path}". Paths must start with "/".`) |
| 221 | |
| 222 | app.all(path, context => proxyRequest(context, route, fetchImpl, allowedOrigins)) |
| 223 | app.all(`${path}/*`, context => proxyRequest(context, route, fetchImpl, allowedOrigins)) |
| 224 | } |
| 225 | |
| 226 | const registerProxyRoutes = ( |
| 227 | app: Hono, |
no test coverage detected