Proxy package
This commit is contained in:
16
packages/proxy/src/cli.ts
Normal file
16
packages/proxy/src/cli.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
import { spawn } from "node:child_process";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const port = process.argv[2] || "3001";
|
||||
|
||||
// Run the CORS proxy
|
||||
const child = spawn("node", [path.join(__dirname, "cors-proxy.js"), port], {
|
||||
stdio: "inherit",
|
||||
});
|
||||
|
||||
child.on("exit", (code) => {
|
||||
process.exit(code || 0);
|
||||
});
|
||||
Reference in New Issue
Block a user