[Bug/Critical] MapControllers laeuft nur in Development - API liefert in Produktion 404 #33
Labels
No labels
bug
critical
database
duplicate
enhancement
help wanted
invalid
performance
question
refactoring
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Aceless/RecipePlanner#33
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In
backend/RecipePlannerApi/Program.csstehtapp.MapControllers()innerhalb des Development-Blocks:backend/DockerfilesetztENV ASPNETCORE_ENVIRONMENT=Production.Auswirkung
Im Container ist kein einziger Endpunkt registriert. Alle Requests laufen auf 404, die App kann sich weder anmelden noch Daten laden.
Fix
app.MapControllers()aus demifherausziehen, nurMapOpenApi()undMapScalarApiReference()auf Development beschraenken.Erledigt.
app.MapControllers()steht inProgram.csnicht mehr im Development-Block. NurMapOpenApi()undMapScalarApiReference()sind weiterhin auf Development beschränkt.Geprüft: Die Anwendung wurde mit
ASPNETCORE_ENVIRONMENT=Productiongegen eine Testdatenbank gestartet, anschließend liefen 51 End-to-End-Prüfungen über alle Controller durch. Vorher hätte in dieser Konfiguration jeder Aufruf 404 ergeben.Branch
backend/issue-fixes, Commits2a1cc95.