welsonjs/WelsonJS.Augmented/WelsonJS.Launcher/IApiEndpoint.cs
Namhyeon, Go 96986d1417 Migrate logging to log4net and refactor API endpoints
Replaces the custom ICompatibleLogger and TraceLogger with log4net for logging, introducing LoggingBootstrap for environment-aware log4net initialization. Refactors all resource tools to use IApiEndpoint and moves them to the ApiEndpoints namespace. Updates project references, configuration, and adds a log4net.config for consistent logging setup.
2026-01-26 14:51:12 +09:00

30 lines
1.2 KiB
C#

// IResourceTool.cs
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2025 Catswords OSS and WelsonJS Contributors
// https://github.com/gnh1201/welsonjs
//
using System.Net;
using System.Threading.Tasks;
namespace WelsonJS.Launcher
{
/// <summary>
/// Defines a contract for resource tools that can handle specific HTTP requests.
/// </summary>
public interface IApiEndpoint
{
/// <summary>
/// Determines whether this tool can handle the specified path.
/// </summary>
/// <param name="path">The request path to check.</param>
/// <returns>True if this tool can handle the request; otherwise, false.</returns>
bool CanHandle(string path);
/// <summary>
/// Asynchronously processes the HTTP request for the specified path.
/// </summary>
/// <param name="context">The HTTP listener context containing request and response objects.</param>
/// <param name="path">The request path to handle.</param>
/// <returns>A task representing the asynchronous operation.</returns>
Task HandleAsync(HttpListenerContext context, string path);
}
}