Ejemplo n.º 1
0
 public DeckHubClient(DeckHubOptions options, ILogger <DeckHubClient> logger)
 {
     _logger = logger;
     if (!options.Offline)
     {
         _http = new HttpClient
         {
             BaseAddress = new Uri(options.Api),
         };
         _http.DefaultRequestHeaders.Add("API-Key", options.ApiKey);
     }
 }
Ejemplo n.º 2
0
        private void ConfigureRoutes(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            var options = DeckHubOptions.Bind(Configuration);
            var client  =
                new DeckHubClient(options, loggerFactory.CreateLogger <DeckHubClient>());

            app.UseRouter(routes =>
            {
                InternalFilesRouter.Add(routes);
                ThemeRouter.Add(routes);
                ImagesRouter.Add(routes);
                DeckRouter.Add(routes, client, options, loggerFactory);
                ShotRouter.Add(routes, client, options, loggerFactory);
            });
        }