mirror of
https://github.com/Radiquum/AniX.git
synced 2025-09-03 21:15:35 +05:00
feat: add run-all services
This commit is contained in:
parent
27554eb373
commit
c8a7a38b52
2 changed files with 30 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev-with-services": "node ./run-all.dev.js",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
|
|
29
run-all.dev.js
Normal file
29
run-all.dev.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
const { spawn } = require("child_process");
|
||||
|
||||
const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm";
|
||||
|
||||
const client = spawn(npm, ["run", "dev"], { shell: true });
|
||||
const parser = spawn(npm, ["run", "serve"], { shell: true, cwd: "./player-parser" });
|
||||
const proxy = spawn(npm, ["run", "serve"], { shell: true, cwd: "./api-prox" });
|
||||
|
||||
const clientInfo = "\x1b[36m[client]\x1b[0m";
|
||||
const parserInfo = "\x1b[33m[parser]\x1b[0m";
|
||||
const proxyInfo = "\x1b[31m[proxy]\x1b[0m";
|
||||
|
||||
console.log(`${clientInfo} CMD: ${client.spawnargs.toString()}`);
|
||||
console.log(`${clientInfo} PID: ${client.pid}`);
|
||||
console.log(`${parserInfo} CMD: ${parser.spawnargs.toString()}`);
|
||||
console.log(`${parserInfo} PID: ${parser.pid}`);
|
||||
console.log(`${proxyInfo} CMD: ${proxy.spawnargs.toString()}`);
|
||||
console.log(`${proxyInfo} PID: ${proxy.pid}`);
|
||||
console.log(`\n`);
|
||||
|
||||
client.stdout.on("data", (data) =>
|
||||
console.log(clientInfo, data.toString())
|
||||
);
|
||||
parser.stdout.on("data", (data) =>
|
||||
console.log(parserInfo, data.toString())
|
||||
);
|
||||
proxy.stdout.on("data", (data) =>
|
||||
console.log(proxyInfo, data.toString())
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue