From b8614b16e958cbacfff05a8e2f79f8e4410654b8 Mon Sep 17 00:00:00 2001 From: Guillermo Serrahima Date: Thu, 19 Feb 2026 12:18:34 +0100 Subject: added frontend (vanilla-ts with bun) --- backend/main.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'backend') diff --git a/backend/main.go b/backend/main.go index f5c754c..429dd37 100644 --- a/backend/main.go +++ b/backend/main.go @@ -7,6 +7,8 @@ import ( ) func helloHandler(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Content-Type", "application/json") w.Write([]byte("Hello, World!")) } @@ -20,10 +22,5 @@ func requestServer() { func main() { http.HandleFunc("/", helloHandler) - go func() { - err := http.ListenAndServe(":8080", nil) - fmt.Println(err) // don't ignore errors - }() - - requestServer() + http.ListenAndServe(":8080", nil) } -- cgit v1.2.3