()
| 4604 | |
| 4605 | // Start watcher on server start |
| 4606 | async function startServer() { |
| 4607 | ['google', 'anthropic', 'openai', 'xai', 'openrouter', 'together', 'mistral', 'deepseek', 'amazon-bedrock', 'azure', 'github-copilot'].forEach(p => importCurrentAuthToPool(p)); |
| 4608 | |
| 4609 | const port = await findAvailablePort(DEFAULT_PORT); |
| 4610 | app.listen(port, () => { |
| 4611 | console.log(`Server running at http://localhost:${port}`); |
| 4612 | // Initial sync on startup if enabled |
| 4613 | setTimeout(() => { |
| 4614 | const studio = loadStudioConfig(); |
| 4615 | if (studio.githubAutoSync) { |
| 4616 | console.log('[AutoSync] Triggering initial sync...'); |
| 4617 | triggerGitHubAutoSync(); |
| 4618 | } |
| 4619 | }, 5000); |
| 4620 | }); |
| 4621 | } |
| 4622 | |
| 4623 | if (require.main === module) { |
| 4624 | startServer(); |
no test coverage detected