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(); }
// 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(); }