Files

24 lines
437 B
Go

package client_api
import (
"encoding/json"
"net/http"
)
type RecentlyAdded struct {
Data []int `json:"data"`
}
func recentlyAddedHandler(data_dir string, w http.ResponseWriter, r *http.Request) {
log.Debugf("/recently_added called\n")
return_json := RecentlyAdded{
Data: []int{4, 5, 6},
}
data, err := json.Marshal(return_json)
if err != nil {
log.Errorf("Could not marshal data: %v\n", err)
return
}
w.Write(data)
}