22 lines
367 B
Go
22 lines
367 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
func handler(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Println("Running handler...")
|
|
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(http.StatusOK)
|
|
|
|
json.NewEncoder(w).Encode(map[string]any{})
|
|
}
|
|
|
|
func main() {
|
|
http.HandleFunc("/", handler)
|
|
|
|
http.ListenAndServe(":8080", nil)
|
|
}
|