err
All checks were successful
cicd / ci (push) Successful in 2m8s

This commit is contained in:
Bel LaPointe
2025-10-06 07:29:12 -06:00
parent 38786d3b1a
commit d3e98d543e

View File

@@ -25,19 +25,21 @@ type (
func run() error {
f := os.Args[1]
b, err := os.ReadFile(f)
if err != nil {
return err
}
type Route struct {
}
var data Data
if err := yaml.Unmarshal(b, &data); err != nil {
return err
}
return http.ListenAndServe(":3001", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
b, err := os.ReadFile(f)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
type Route struct {
}
var data Data
if err := yaml.Unmarshal(b, &data); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
k := r.URL.Path
v, ok := data.Routes[k]