Implement WebSocket-based webhook relay with enhanced SvelteKit integration

Co-authored-by: lukeslakemail <lukeslakemail@gmail.com>
This commit is contained in:
Cursor Agent
2025-08-30 03:49:29 +00:00
parent 40a7c607f6
commit 6a25e95fd6
21 changed files with 2291 additions and 151 deletions

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env node
import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const projectRoot = join(__dirname, '..');
// Start SvelteKit dev server
const svelteProcess = spawn('npm', ['run', 'dev'], {
cwd: projectRoot,
stdio: 'inherit',
shell: true
});
// Start WebSocket server
const wsProcess = spawn('node', ['scripts/websocket-server.js'], {
cwd: projectRoot,
stdio: 'inherit',
shell: true
});
// Handle process cleanup
process.on('SIGINT', () => {
console.log('\nShutting down servers...');
svelteProcess.kill('SIGINT');
wsProcess.kill('SIGINT');
process.exit(0);
});
process.on('SIGTERM', () => {
svelteProcess.kill('SIGTERM');
wsProcess.kill('SIGTERM');
process.exit(0);
});
console.log('Starting SvelteKit development environment...');
console.log('SvelteKit: http://localhost:5173');
console.log('WebSocket: ws://localhost:4001');
console.log('Press Ctrl+C to stop all servers');