コード例 #1
0
ファイル: DeckHubRouter.cs プロジェクト: DeckHubApp/cli
 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());
 }
コード例 #2
0
        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());
            });
        }