From 9ea1d70c784b3e1014e096d7e2e8eba19d59e034 Mon Sep 17 00:00:00 2001 From: mahamtr Date: Tue, 18 Mar 2025 19:39:02 +0100 Subject: [PATCH] Introduce bad practices in backend and frontend for demonstration purposes --- backend/Program.cs | 5 +++++ frontend/src/app/app.component.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/backend/Program.cs b/backend/Program.cs index fda9a7d..feb2c3d 100644 --- a/backend/Program.cs +++ b/backend/Program.cs @@ -36,6 +36,11 @@ .WithName("GetWeatherForecast") .WithOpenApi(); +app.MapGet("/bad-endpoint", () => { + string connectionString = "Server=myServer;Database=myDB;User=myUser;Password=myPassword;"; + return connectionString; +}); + app.Run(); record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary) diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index 9d6b2f1..e951a6a 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -7,4 +7,9 @@ import { Component } from '@angular/core'; }) export class AppComponent { title = 'frontend'; + + ngOnInit() { + document.body.style.backgroundColor = 'red'; + console.log('This is a debug log that should not be in production'); + } }