Refactor into client + server backends

This commit is contained in:
2023-01-04 21:34:26 -07:00
parent 2087cf2c03
commit 38127948bd
16 changed files with 361 additions and 120 deletions
+23
View File
@@ -0,0 +1,23 @@
package client_api
import (
"encoding/json"
"net/http"
)
type InProgress struct {
Data []int `json:"data"`
}
func inProgressHandler(data_dir string, w http.ResponseWriter, r *http.Request) {
log.Debugf("/in_progress called\n")
return_json := InProgress{
Data: []int{1, 2, 3},
}
data, err := json.Marshal(return_json)
if err != nil {
log.Errorf("Could not marshal data: %v\n", err)
return
}
w.Write(data)
}