Esempio n. 1
0
        public static async Task Main(string[] args)
        {
            var webHost = CreateWebHostBuilder(args).Build();

            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                await Task.Run(() => NGDP.LoadAllIndexes());

                Console.WriteLine("Loaded indexes");

                var keys = await KeyService.LoadKeys();

                Console.WriteLine("Loaded " + keys.Count + " keys");
            }

            await webHost.RunAsync();
        }
Esempio n. 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                NGDP.LoadAllIndexes();
            }

            KeyService.LoadKeys();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseResponseCompression();

            app.UseCors("AllowSpecificOrigin");

            app.UseMvc();
        }