A dummy Song handler was added.
This commit is contained in:
parent
18bd1fb12d
commit
07d11ce3ff
@ -54,7 +54,7 @@ func main() {
|
||||
s.Handler(http.MethodGet, "/", djh.PlaylistNext)
|
||||
|
||||
s = r.Sub("/song")
|
||||
s.Handler(http.MethodGet, "/", http.NotFound)
|
||||
s.Handler(http.MethodGet, "/", djh.Song)
|
||||
|
||||
srv := ihttp.NewHttpServer(r)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"dwelling-radio/internal/radio"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
@ -47,3 +48,15 @@ func (dj *DJHandlers) PlaylistNext(w http.ResponseWriter, _ *http.Request) {
|
||||
}
|
||||
fmt.Fprint(w, nxt)
|
||||
}
|
||||
|
||||
func (dj *DJHandlers) Song(w http.ResponseWriter, r *http.Request) {
|
||||
isList := r.URL.Query().Has("list")
|
||||
w.Header().Add("Content-Type", "application/json")
|
||||
if isList {
|
||||
// TODO
|
||||
json.NewEncoder(w).Encode("")
|
||||
} else {
|
||||
// TODO
|
||||
json.NewEncoder(w).Encode("")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user