Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/api/SmartEventBooking.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/client/src/environments/environment.development.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const environment = {
production: false,
apiUrl: 'https://localhost:7134/api'
production: false
};
3 changes: 1 addition & 2 deletions src/client/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export const environment = {
production: true,
apiUrl: 'https://localhost:7134/api'
production: true
};
Loading