using System; using System.Text.Json; using System.Collections; using System.Collections.Generic; using System.Linq; using Vibe; namespace NiftyCSX; public class ApiNode : CsxNode { public string Method {get; set;} = "POST"; public List Descriptions {get;set;} = new List(); public object[]? Parameters {get;set;} public ApiNode(params object[] parameters){ Parameters = parameters; } public override void OnRender() { if(RouteMatchService.MatchRoute(Context.Request.Url.AbsolutePath, this["Route"] as string, out var parameters)){ Context.Params = parameters; foreach(var node in ChildNodes){ switch(node){ case Action action: action(() => Console.WriteLine(""), Context); break; case Action action: action(this, Context); break; } } } } }