diff options
| author | Guillermo Serrahima <dev@vylion.com> | 2026-02-19 12:18:34 +0100 |
|---|---|---|
| committer | Guillermo Serrahima <dev@vylion.com> | 2026-02-19 12:18:34 +0100 |
| commit | b8614b16e958cbacfff05a8e2f79f8e4410654b8 (patch) | |
| tree | 68d89f394ff5f34259e59af76cc4e6408a6e392a /backend | |
| parent | f81aae44181222a2792d6a91c1506075969a81e8 (diff) | |
| download | llostre-b8614b16e958cbacfff05a8e2f79f8e4410654b8.tar.xz llostre-b8614b16e958cbacfff05a8e2f79f8e4410654b8.zip | |
added frontend (vanilla-ts with bun)
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/main.go | 9 |
1 files changed, 3 insertions, 6 deletions
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) } |
