Exemple #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            Configuration.LoadPrefixValues(
                "HS_",
                "../../apiconfig.json;../../secrets/apiconfig-secrets.json");

            _Config = services.AddPrefixConfig <HsConfig>();

            services
            .AddUsingDescriptor <StreamingManager>()
            .AddUsingDescriptor <MailNotifications>()
            .AddUsingDescriptor <NotificationsManager>();

            services
            .AddControllers()
            .AddNewtonsoftJson(o => {
                o.SerializerSettings.ContractResolver      = new DefaultContractResolver();
                o.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
            });
        }
Exemple #2
0
 public static void VerifyUtilAuth(this HsConfig config, string key)
 {
     VerifyUtilAuth(config?.UtilAuthKey, key);
 }
Exemple #3
0
 public static void VerifyClientToken(this HsConfig config, string clientToken)
 {
     VerifyClientToken(config?.ClientToken, clientToken);
 }