mux.HandleFunc("/api/getSongFiles", DBwrapper.GetSongFiles)
mux.Handle("/", http.FileServer(http.Dir("./public/")))
+ // api/songs/ - api related to raw songs
+ mux.HandleFunc("/api/songs/get", DBwrapper.SongsGet)
+ mux.HandleFunc("/api/songs/create", DBwrapper.SongsCreate)
+ mux.HandleFunc("/api/songs/update/{id}", DBwrapper.SongsUpdateById)
+ mux.HandleFunc("/api/songs/delete/{id}", DBwrapper.SongsDeleteById)
+
+ // api/rooms - api related to managaing rooms
+ mux.HandleFunc("/api/rooms/get", DBwrapper.RoomsGet)
+ mux.HandleFunc("/api/rooms/create/", DBwrapper.RoomsCreate)
+ mux.HandleFunc("/api/rooms/add/{name}/{id}", DBwrapper.RoomsAddByNameAndId)
+ mux.HandleFunc("/api/rooms/remove/{name}/{id}", DBwrapper.RoomsRemoveByNameAndId)
+ mux.HandleFunc("/api/rooms/delete/{name}", DBwrapper.RoomsDeleteByName)
+
+ // api/files - api related to song files
+ mux.HandleFunc("/api/files/get", DBwrapper.FilesGet)
+ mux.HandleFunc("/api/files/createWithURL", DBwrapper.FilesCreateWithURL)
+ mux.HandleFunc("/api/files/createWithUpload", DBwrapper.FilesCreateWithUpload)
+ mux.HandleFunc("/api/files/delete/{id}", DBwrapper.FilesDeleteById)
+ mux.HandleFunc("/api/files/rename/{id}", DBwrapper.FilesRenameById)
+ mux.HandleFunc("/api/files/replace/{id}", DBwrapper.FilesReplaceById)
+
listenPort := ":" + strconv.Itoa(*paramPort)
fmt.Println("Starting server...")
--- /dev/null
+package dbhandling
+
+import "net/http"
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) FilesGet(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) FilesCreateWithURL(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) FilesCreateWithUpload(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) FilesDeleteById(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) FilesRenameById(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) FilesReplaceById(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
--- /dev/null
+package dbhandling
+
+import "net/http"
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) RoomsGet(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) RoomsCreate(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "POST" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) RoomsAddByNameAndId(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "POST" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) RoomsRemoveByNameAndId(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ *
+ **/
+func (dbw *DBWrapper) RoomsDeleteByName(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
--- /dev/null
+package dbhandling
+
+import "net/http"
+
+/** TODO
+ * Get all songs, and all their assosciated information from the db
+ **/
+func (dbw *DBWrapper) SongsGet(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "GET" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+
+ // Here we should return an entire list of songs
+}
+
+/** TODO
+ * Create a new song in the database (only in the main list don't add to anything)
+ **/
+func (dbw *DBWrapper) SongsCreate(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "POST" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ * Create a new song in the database (only in the main list don't add to anything)
+ **/
+func (dbw *DBWrapper) SongsCreate(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "POST" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ * Create a new song in the database (only in the main list don't add to anything)
+ **/
+func (dbw *DBWrapper) SongsUpdateById(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "PUT" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}
+
+/** TODO
+ * Create a new song in the database (only in the main list don't add to anything)
+ **/
+func (dbw *DBWrapper) SongsDeleteById(w http.ResponseWriter, r *http.Request) {
+ if r.Method != "DELETE" {
+ w.WriteHeader(http.StatusMethodNotAllowed)
+ return
+ }
+}