Files
logikonline e79fd3f281 feat: add .NET host process integration
Implements native host process support with .NET backend:
- Add .NET host project with HTTP endpoints (health check, hello world)
- Configure multi-platform host executables in addon.json
- Add host communication methods in main process
- Create host demo tab in UI
- Add .gitignore for .NET build artifacts

The host process runs on a dynamic port and communicates via HTTP with the main addon process.
2026-01-18 14:48:43 -05:00

36 lines
992 B
C#

var builder = WebApplication.CreateBuilder(args);
// Configure port from environment variable (set by GitCaddy AddonManager)
var port = Environment.GetEnvironmentVariable("ADDON_HOST_PORT") ?? "47933";
builder.WebHost.UseUrls($"http://127.0.0.1:{port}");
var app = builder.Build();
// Root endpoint
app.MapGet("/", () => new {
status = "ok",
service = "MyFirstAddon.Host",
version = "1.0.0"
});
// Health check endpoint (required by GitCaddy)
app.MapGet("/health", () => new {
status = "healthy",
timestamp = DateTime.UtcNow
});
// Hello World endpoint - demonstrates a simple addon host function
app.MapGet("/hello", () => new {
message = "Hello World from MyFirstAddon.Host!",
timestamp = DateTime.UtcNow
});
// Hello endpoint with name parameter
app.MapGet("/hello/{name}", (string name) => new {
message = $"Hello, {name}!",
timestamp = DateTime.UtcNow
});
Console.WriteLine($"MyFirstAddon.Host starting on http://127.0.0.1:{port}");
app.Run();