Spaces:
Paused
Paused
Mahdi Naser Moghadasi
Claude Opus 4.5
Add GitHub sync daemon to push logs to mahdinaser/brightmind repo
96fdde4 Download scripts/start.js from brightmind-ai/ElevAIt: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/brightmind-ai/ElevAIt/resolve/main/scripts/start.js
- Command line
-
hf download hf://spaces/brightmind-ai/ElevAIt/scripts/start.js
-
curl -L -o start.js https://huggingface.co/spaces/brightmind-ai/ElevAIt/resolve/main/scripts/start.js
1.2 kB
| /** | |
| * Start script for ElevAIt | |
| * Runs both the Next.js server and the GitHub sync daemon | |
| */ | |
| const { spawn } = require('child_process'); | |
| const path = require('path'); | |
| console.log('π Starting ElevAIt...'); | |
| // Start the GitHub sync daemon | |
| const daemonPath = path.join(__dirname, 'github-sync-daemon.js'); | |
| const daemon = spawn('node', [daemonPath], { | |
| stdio: 'inherit', | |
| env: process.env | |
| }); | |
| daemon.on('error', (err) => { | |
| console.error('β Failed to start sync daemon:', err.message); | |
| }); | |
| // Start the Next.js server | |
| const server = spawn('node', ['server.js'], { | |
| stdio: 'inherit', | |
| env: process.env, | |
| cwd: process.cwd() | |
| }); | |
| server.on('error', (err) => { | |
| console.error('β Failed to start Next.js server:', err.message); | |
| process.exit(1); | |
| }); | |
| server.on('exit', (code) => { | |
| console.log(`Next.js server exited with code ${code}`); | |
| daemon.kill(); | |
| process.exit(code); | |
| }); | |
| // Handle shutdown | |
| process.on('SIGTERM', () => { | |
| console.log('π Received SIGTERM, shutting down...'); | |
| daemon.kill('SIGTERM'); | |
| server.kill('SIGTERM'); | |
| }); | |
| process.on('SIGINT', () => { | |
| console.log('π Received SIGINT, shutting down...'); | |
| daemon.kill('SIGINT'); | |
| server.kill('SIGINT'); | |
| }); | |