(args: string[] = process.argv.slice(2), env: NodeJS.ProcessEnv = process.env)
| 194 | } |
| 195 | |
| 196 | export async function startRuntimeNodeCli(args: string[] = process.argv.slice(2), env: NodeJS.ProcessEnv = process.env): Promise<RuntimeNodeHttpServer> { |
| 197 | if (args[0] !== "serve") { |
| 198 | throw new Error("Usage: runtime-node serve [--host HOST] [--port PORT] [--token TOKEN]") |
| 199 | } |
| 200 | |
| 201 | const server = await startRuntimeNodeServe(parseRuntimeNodeServeConfig(args, env)) |
| 202 | console.log(`Runtime listening at ${server.url}`) |
| 203 | return server |
| 204 | } |
| 205 | |
| 206 | if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { |
| 207 | startRuntimeNodeCli().catch((error) => { |
no test coverage detected