aboutsummaryrefslogtreecommitdiff
path: root/backend/main.go
diff options
context:
space:
mode:
authorGuillermo Serrahima <dev@vylion.com>2026-02-19 12:18:34 +0100
committerGuillermo Serrahima <dev@vylion.com>2026-02-19 12:18:34 +0100
commitb8614b16e958cbacfff05a8e2f79f8e4410654b8 (patch)
tree68d89f394ff5f34259e59af76cc4e6408a6e392a /backend/main.go
parentf81aae44181222a2792d6a91c1506075969a81e8 (diff)
downloadllostre-b8614b16e958cbacfff05a8e2f79f8e4410654b8.tar.xz
llostre-b8614b16e958cbacfff05a8e2f79f8e4410654b8.zip
added frontend (vanilla-ts with bun)
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go9
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)
}