(config: DevProxyConfig, cliOptions: DevProxyCliOptions)
| 37 | }) |
| 38 | |
| 39 | const startDevProxyServer = (config: DevProxyConfig, cliOptions: DevProxyCliOptions) => { |
| 40 | let app = createDevProxyApp(config) |
| 41 | const { host, port } = resolveDevProxyServerOptions(config.server, cliOptions) |
| 42 | const server = serve({ |
| 43 | fetch: (request, env) => app.fetch(request, env), |
| 44 | hostname: host, |
| 45 | port, |
| 46 | }) |
| 47 | |
| 48 | return { |
| 49 | host, |
| 50 | port, |
| 51 | server, |
| 52 | updateConfig(nextConfig: DevProxyConfig) { |
| 53 | app = createDevProxyApp(nextConfig) |
| 54 | }, |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | const createDevProxyRuntime = (initialConfig: DevProxyConfig, cliOptions: DevProxyCliOptions) => { |
| 59 | let runtime = startDevProxyServer(initialConfig, cliOptions) |
no test coverage detected