#!/usr/bin/env node /** * Test HTTP server functionality */ import { HttpServer } from './http-server.js'; async function testHttpServer() { console.log('🌐 Testing HTTP Server...\n'); // Set environment variables process.env.LARAVEL_API_BASE_URL = 'https://example.com'; process.env.MCP_SERVER_PORT = '3001'; // Use different port for testing const httpServer = new HttpServer(); try { console.log('1. Initializing HTTP server...'); await httpServer.initialize(); console.log('āœ… HTTP server initialized'); console.log('2. Starting HTTP server...'); await httpServer.start(); console.log('āœ… HTTP server started'); console.log('\nšŸŽ‰ HTTP Server test completed!'); console.log('Server should be running on http://0.0.0.0:3001'); console.log('\nAvailable endpoints:'); console.log('• GET /health - Health check'); console.log('• GET /tools - List all tools'); console.log('• GET /stats - Server statistics'); console.log('• POST /tools/:toolName/execute - Execute tool'); // Keep server running for testing console.log('\nPress Ctrl+C to stop the server...'); } catch (error) { console.error('āŒ HTTP server test failed:', error.message); console.error('Stack:', error.stack); process.exit(1); } } testHttpServer();