Spaces:
Running
Running
| const concurrently = require('concurrently'); | |
| const path = require('path'); | |
| // Set UTF-8 encoding for Windows console | |
| process.env.PYTHONIOENCODING = 'utf-8'; | |
| console.log('Starting services...'); | |
| // Define paths relative to the backend root | |
| const backendRoot = path.resolve(__dirname, '../../'); | |
| const excelServicePath = path.join(backendRoot, 'excel_module', 'api', 'excel_service.py'); | |
| const mlServicePath = path.join(backendRoot, 'ml_module', 'api', 'main.py'); | |
| const serverPath = path.join(backendRoot, 'core', 'server.js'); | |
| const signinServicePath = path.join(backendRoot, 'signin', 'main.py'); | |
| const text2sqlServicePath = path.join(backendRoot, 'self_service_module', 'api', 'text2sql_router.py'); | |
| concurrently([ | |
| { | |
| command: `python "${text2sqlServicePath}"`, | |
| name: 'TEXT2SQL_API', | |
| prefixColor: 'cyan', | |
| env: { PYTHONIOENCODING: 'utf-8' } | |
| }, | |
| { | |
| command: `python "${excelServicePath}"`, | |
| name: 'EXCEL_API', | |
| prefixColor: 'magenta', | |
| env: { PYTHONIOENCODING: 'utf-8' } | |
| }, | |
| { | |
| command: `python "${mlServicePath}"`, | |
| name: 'ML_API', | |
| prefixColor: 'blue', | |
| env: { PYTHONIOENCODING: 'utf-8' } | |
| }, | |
| { | |
| command: `python "${signinServicePath}"`, | |
| name: 'SIGNIN_API', | |
| prefixColor: 'yellow', | |
| env: { PYTHONIOENCODING: 'utf-8' } | |
| }, | |
| { | |
| command: `node "${serverPath}"`, | |
| name: 'SERVER', | |
| prefixColor: 'green' | |
| } | |
| ], { | |
| prefix: 'name', | |
| killOthers: ['failure', 'success'], | |
| restartTries: 3, | |
| }); |