initial commit

This commit is contained in:
2025-10-04 01:05:07 +02:00
commit 78fb4aeb8f
3 changed files with 75 additions and 0 deletions

29
backend/main.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"encoding/json"
"log"
"net/http"
)
type Response struct {
Message string `json:"message"`
Headers map[string][]string `json:"headers"`
Path string `json:"path"`
}
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
response := Response{
Message: "Hello from backend server!",
Headers: r.Header,
Path: r.URL.Path,
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(response)
})
log.Println("Backend server démarré sur :8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}