Web API and HTTP interface for Orion IRC Server
$ dotnet add package Orion.Core.Server.Web
Web API and HTTP interface for the Orion IRC Server project.
IRC is not dead, long live IRC!
Orion.Core.Server.Web provides the web API and HTTP interface for the Orion IRC Server. This library allows you to add a web-based management interface, REST APIs, and other HTTP-based functionality to your Orion IRC Server implementation.
dotnet add package Orion.Core.Server.Web
Or using the Package Manager Console:
Install-Package Orion.Core.Server.Web
using Microsoft.AspNetCore.Builder;
using Orion.Core.Server.Data.Config.Sections;
using Orion.Core.Server.Web.Extensions;
public static void ConfigureWeb(WebApplicationBuilder builder, WebHttpConfig webConfig)
{
builder.WebHost.ConfigureKestrelFromConfig(webConfig);
// Additional web configuration
}
using Microsoft.AspNetCore.Builder;
using Orion.Core.Server.Web.Extensions;
public static void ConfigureJson(WebApplicationBuilder builder)
{
builder.Services.ConfigureHttpJsonOptions(WebJsonExtension.ConfigureWebJson());
// Your application's JSON is now configured with Orion settings
}
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
public static IEndpointRouteBuilder MapMyApi(this IEndpointRouteBuilder endpoints)
{
var group = endpoints.MapGroup("api/myfeature")
.WithTags("MyFeature")
.WithDescription("My feature APIs");
group.MapGet("/status", () => Results.Ok(new { Status = "Running" }))
.WithName("GetStatus")
.WithDescription("Get the status of my feature");
return endpoints;
}
Example YAML configuration for the web interface:
web_http:
is_enabled: true
listen_address: 0.0.0.0
listen_port: 23021
jwt_auth:
issuer: Orion
audience: Orion
expiration_in_minutes: 44640 # 31 days
refresh_token_expiry_days: 1
This project is licensed under the MIT License - see the LICENSE file for details.