fix: address code review findings from story #01

- Makefile: -include .env (soft) so fresh clone doesn't hard-fail
- main.go: replace log.Fatalf-in-goroutine with error channel; startup
  failures now reach main goroutine so defer pool.Close() always runs
- main.go: context.WithTimeout(30s) on database.Connect to fail fast
  instead of hanging indefinitely on unreachable Postgres
- router.go: store pool on Echo context via middleware so future story
  handlers can retrieve it with c.Get("pool")
- config.go: require DATABASE_URL explicitly (log.Fatal if missing)
  instead of falling back to hardcoded credentials
- HelloWorld.test.ts: URL-aware fetch stub + afterEach restoreAllMocks;
  add flushPromises test verifying backend status renders

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 17:14:29 +02:00
co-authored by Claude Sonnet 4.6
parent 24a368cac3
commit 4d28916c7b
5 changed files with 60 additions and 19 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
include .env
# -include: silently skip if .env doesn't exist (e.g. fresh clone before 'cp .env.example .env')
-include .env
export
.PHONY: dev-db migrate-up migrate-down run-backend run-frontend test fmt