From b6ac9f7ffc756bb7c90e96d0e475730ac6179272 Mon Sep 17 00:00:00 2001 From: viktorpekhun <129255792+viktorpekhun@users.noreply.github.com> Date: Thu, 30 Apr 2026 15:34:47 +0300 Subject: [PATCH] done --- src/api/SmartEventBooking.Web/Program.cs | 15 ++++++++------- .../src/environments/environment.development.ts | 3 +-- src/client/src/environments/environment.ts | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/api/SmartEventBooking.Web/Program.cs b/src/api/SmartEventBooking.Web/Program.cs index 019cd55..9758067 100644 --- a/src/api/SmartEventBooking.Web/Program.cs +++ b/src/api/SmartEventBooking.Web/Program.cs @@ -52,15 +52,9 @@ await app.InitialiseDatabaseAsync(); -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} -else +if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Errors/500"); - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } @@ -75,6 +69,13 @@ app.UseAuthentication(); app.UseAuthorization(); +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); + app.MapGet("/", () => Results.Redirect("/swagger")).ExcludeFromDescription(); +} + app.MapGet("/health/db", async (ApplicationDbContext dbContext, CancellationToken cancellationToken) => { var canConnect = await dbContext.Database.CanConnectAsync(cancellationToken); diff --git a/src/client/src/environments/environment.development.ts b/src/client/src/environments/environment.development.ts index 85e556c..ffe8aed 100644 --- a/src/client/src/environments/environment.development.ts +++ b/src/client/src/environments/environment.development.ts @@ -1,4 +1,3 @@ export const environment = { - production: false, - apiUrl: 'https://localhost:7134/api' + production: false }; diff --git a/src/client/src/environments/environment.ts b/src/client/src/environments/environment.ts index f45be56..3612073 100644 --- a/src/client/src/environments/environment.ts +++ b/src/client/src/environments/environment.ts @@ -1,4 +1,3 @@ export const environment = { - production: true, - apiUrl: 'https://localhost:7134/api' + production: true };