mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-12-05 14:44:41 -05:00
Add paddock briefing RSS backend spike
This commit is contained in:
1 parent
79b0b9f469
commit
84a8827244
12 files changed
+804
-2
No files matched your search
@@ -115,6 +115,24 @@ func (s *Server) handleSessions(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, sessions)
|
||||
}
|
||||
|
||||
// --- /api/v1/news ---
|
||||
|
||||
func (s *Server) handleNews(w http.ResponseWriter, r *http.Request) {
|
||||
if !s.hasLocalQuery() {
|
||||
writeJSON(w, []query.NewsItem{})
|
||||
return
|
||||
}
|
||||
|
||||
limit, _ := strconv.Atoi(r.URL.Query().Get("limit"))
|
||||
source := strings.TrimSpace(r.URL.Query().Get("source"))
|
||||
items, err := s.query.ListNews(limit, source)
|
||||
if err != nil {
|
||||
writeError(w, err, http.StatusInternalServerError, false)
|
||||
return
|
||||
}
|
||||
writeJSON(w, items)
|
||||
}
|
||||
|
||||
// --- /api/v1/drivers ---
|
||||
|
||||
func (s *Server) handleDrivers(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in new issue
Block a user