<commit_before>using System.Collections.Generic;
using Carter;
using Carter.ModelBinding;
using Carter.Response;
using LightInject;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using ReadingList.Trello.Models;

namespace ReadingList.Carter
{
    public class Startup
    {
        readonly string AllowSpecificOrigins = "_allowSpecificOrigins";
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }
        
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure<TrelloAuthSettings>(Configuration.GetSection(nameof(TrelloAuthSettings)));
            services.AddSingleton<ITrelloAuthModel>(sp => sp.GetRequiredService<IOptions<TrelloAuthSettings>>().Value);
            services.AddCarter(
                options: options =>
                {
                    options.OpenApi.Securities = new Dictionary<string, OpenApiSecurity>
                    {
                        {
                            nameof(TrelloAuthSettings.TrelloAPIKey),
                            new OpenApiSecurity
                            {
                                Type = OpenApiSecurityType.apiKey, Name = nameof(TrelloAuthSettings.TrelloAPIKey),
                                In = OpenApiIn.header
                            }
                        },
                        {
                            nameof(TrelloAuthSettings.TrelloUserToken),
                            new OpenApiSecurity
                            {
                                Type = OpenApiSecurityType.apiKey, Name = nameof(TrelloAuthSettings.TrelloUserToken),<commit_msg>using hostingUrl to serve swagger (#65)<commit_after>using System.Collections.Generic;
using System.IO;
using Carter;
using Carter.ModelBinding;
using Carter.Response;
using LightInject;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using ReadingList.Trello.Models;

namespace ReadingList.Carter
{
    public class Startup
    {
        readonly string AllowSpecificOrigins = "_allowSpecificOrigins";
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }
        
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure<TrelloAuthSettings>(Configuration.GetSection(nameof(TrelloAuthSettings)));
            services.AddSingleton<ITrelloAuthModel>(sp => sp.GetRequiredService<IOptions<TrelloAuthSettings>>().Value);
            services.AddCarter(
                options: options =>
                {
                    options.OpenApi.ServerUrls = new[]
                    {
                        Configuration.GetValue<string>("HostUrl")
                    };
                    options.OpenApi.Securities = new Dictionary<string, OpenApiSecurity>
                    {
                        {
                            nameof(TrelloAuthSettings.TrelloAPIKey),
                            new OpenApiSecurity
                            {
                                Type = OpenApiSecurityType.apiKey, Name = nameof(TrelloAuthSettings.TrelloAPIKey),
                                In = OpenApiIn.header
                            }
                        },
                        {
                            nameof(TrelloAuthSettings.TrelloUserToken),
                            new OpenApiSecurity
                            {
                                Type = OpenApiSecurityType.apiKey, Name = nameof(TrelloAuthSettings.TrelloUserToken),
{'fraction_non_alphanumeric': 0.06628169721315591, 'fraction_numerical': 0.0005021340697966357, 'mean_word_length': 1.7065217391304348, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7123070', 'n_tokens_mistral': 919, 'n_tokens_neox': 896, 'n_words': 149}