Spaces:
Sleeping
Sleeping
feat: complete Ever-Brain engine, MCP server, CLI evb mcp command, Dockerfile and release workflow
61b1da1 Download packages/api/src/index.ts from projectsorg/ever-brain: direct link, hf CLI and curl.
- Browser
- Download file 934 Bytes
-
https://huggingface.co/spaces/projectsorg/ever-brain/resolve/main/packages/api/src/index.ts
- Command line
-
hf download hf://spaces/projectsorg/ever-brain/packages/api/src/index.ts
-
curl -L -o index.ts https://huggingface.co/spaces/projectsorg/ever-brain/resolve/main/packages/api/src/index.ts
934 Bytes
| import { serve } from '@hono/node-server'; | |
| import { app } from './app.js'; | |
| import { config } from './config.js'; | |
| import { logger } from './utils/logger.js'; | |
| const server = serve( | |
| { | |
| fetch: app.fetch, | |
| port: config.port, | |
| }, | |
| (info) => { | |
| logger.info('Server', `Ever-Brain API running on http://localhost:${info.port}`); | |
| logger.info('Server', `Environment: ${config.nodeEnv}`); | |
| if (config.githubToken) { | |
| logger.info('GitHub Auth', 'GITHUB_TOKEN loaded (5,000 req/hr rate limit enabled)'); | |
| } else { | |
| logger.info('GitHub Auth', 'Anonymous mode (60 req/hr rate limit)'); | |
| } | |
| } | |
| ); | |
| // Graceful shutdown handling | |
| const shutdown = () => { | |
| logger.info('Server', 'Shutting down Ever-Brain API gracefully...'); | |
| server.close(() => { | |
| logger.info('Server', 'Ever-Brain API stopped.'); | |
| process.exit(0); | |
| }); | |
| }; | |
| process.on('SIGINT', shutdown); | |
| process.on('SIGTERM', shutdown); | |
| export { app }; | |