public static void Add(IRouteBuilder routes, IDeckHubClient client, DeckHubOptions options, ILoggerFactory loggerFactory) { _client = client; _options = options; _logger = loggerFactory.CreateLogger(typeof(DeckRouter)); routes.MapGet("deckhub/{index}", (req, res, data) => data.Values.TryGetInt("index", out var index) ? Get(res, index) : res.NotFoundAsync()); }
public static void Add(IRouteBuilder routes, IDeckHubClient client, DeckHubOptions options, ILoggerFactory loggerFactory) { _client = client; _options = options; _logger = loggerFactory.CreateLogger(typeof(ShotRouter)); routes.MapPost("shot/{index}", (req, res, data) => { if (data.Values.TryGetInt("index", out var index)) { return(Post(req, res, index)); } return(res.NotFoundAsync()); }); }