Add RoslynBridge.WebApi - ASP.NET Core 8.0 middleware that: - Provides a centralized REST API for accessing multiple VS instances - Manages instance registry with discovery by port, solution, or PID - Proxies requests to the appropriate VS instance - Tracks request/response history for debugging - Auto-cleanup of stale instances via background service Features: - Health endpoints: /api/health, /api/health/ping - Roslyn endpoints: /api/roslyn/projects, /api/roslyn/diagnostics, etc. - Instance management: /api/instances (register, heartbeat, unregister) - History tracking: /api/history, /api/history/stats - Swagger UI at root (/) for API documentation - CORS enabled for web applications Services: - InstanceRegistryService: Thread-safe registry of VS instances - HistoryService: In-memory request/response history (max 1000 entries) - InstanceCleanupService: Background service to remove stale instances - RoslynBridgeClient: HTTP client for proxying to VS instances Update RoslynBridge.sln to include RoslynBridge.WebApi project. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
33 lines
789 B
C#
33 lines
789 B
C#
namespace RoslynBridge.WebApi.Models;
|
|
|
|
/// <summary>
|
|
/// Health check response for service status
|
|
/// </summary>
|
|
public class HealthCheckResponse
|
|
{
|
|
/// <summary>
|
|
/// Overall health status
|
|
/// </summary>
|
|
public string Status { get; set; } = "Healthy";
|
|
|
|
/// <summary>
|
|
/// Web API service status
|
|
/// </summary>
|
|
public string WebApiStatus { get; set; } = "Running";
|
|
|
|
/// <summary>
|
|
/// Visual Studio plugin connection status
|
|
/// </summary>
|
|
public string VsPluginStatus { get; set; } = "Unknown";
|
|
|
|
/// <summary>
|
|
/// Timestamp of the health check
|
|
/// </summary>
|
|
public DateTime Timestamp { get; set; } = DateTime.UtcNow;
|
|
|
|
/// <summary>
|
|
/// API version
|
|
/// </summary>
|
|
public string Version { get; set; } = "1.0.0";
|
|
}
|