mirror of
https://github.com/aljazceru/dvmcp.git
synced 2025-12-17 05:14:24 +01:00
28 lines
654 B
TypeScript
28 lines
654 B
TypeScript
import { CONFIG } from './src/config';
|
|
import { DiscoveryServer } from './src/discovery-server';
|
|
|
|
async function main() {
|
|
try {
|
|
const server = new DiscoveryServer(CONFIG);
|
|
|
|
await server.start();
|
|
|
|
console.log(`DVMCP Discovery Server (${CONFIG.mcp.version}) started`);
|
|
console.log(`Connected to ${CONFIG.nostr.relayUrls.length} relays`);
|
|
|
|
// Handle shutdown
|
|
const cleanup = () => {
|
|
server.cleanup();
|
|
process.exit(0);
|
|
};
|
|
|
|
process.on('SIGINT', cleanup);
|
|
process.on('SIGTERM', cleanup);
|
|
} catch (error) {
|
|
console.error('Failed to start server:', error);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
export default main;
|