public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger <Startup> logger) { _logger = logger; _logger.LogInformation($"Moonglade.Notification.API Version {Utils.AppVersion}\n" + $" Directory: {System.Environment.CurrentDirectory} \n" + $" x64Process: {System.Environment.Is64BitProcess} \n" + $" OSVersion: {System.Runtime.InteropServices.RuntimeInformation.OSDescription} \n" + $" UserName: {System.Environment.UserName}"); var baseDir = env.ContentRootPath; AppDomain.CurrentDomain.SetData(Constants.AppBaseDirectory, baseDir); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseStatusCodePages(); app.UseHsts(); app.UseHttpsRedirection(); } app.UseIpRateLimiting(); app.MapWhen(context => context.Request.Path == "/", builder => { builder.Run(async context => { await context.Response.WriteAsync($"Moonglade.Notification.API Version: {Utils.AppVersion}, {RuntimeInformation.FrameworkDescription}{(System.Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER") is object ? " on Docker" : "")}", Encoding.UTF8); }); }); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }