push my ork
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
using OwnChar.Api.Packets;
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
internal class ApiBuilder(WebApplication app) : IApiBuilder
|
||||
internal class ApiBuilder : IApiBuilder
|
||||
{
|
||||
public void MapRequest(string pattern, Delegate action)
|
||||
{
|
||||
Map(pattern + "/{request}", action);
|
||||
}
|
||||
private readonly Dictionary<ApiMapInfo, Delegate> handlers = [];
|
||||
|
||||
public IReadOnlyDictionary<ApiMapInfo, Delegate> Handlers => handlers;
|
||||
|
||||
public void Map(string pattern, Delegate action)
|
||||
{
|
||||
//app.Map(pattern, action);
|
||||
app.MapPost(pattern, action);
|
||||
handlers.Add(new(pattern, "POST"), action);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user