rave/src/rest.rs
Lyssieth 453a496377
feat: we can now do things
The most crappy basic implementation, but:
- It can list albums
- It can list a single album's tracks
- It can play a song

Closes #1
2023-10-09 15:49:33 +03:00

28 lines
759 B
Rust

use poem::{Endpoint, EndpointExt, Route};
// rest/getLicense
mod get_license;
// rest/getMusicFolders
mod get_music_folders;
// rest/ping
mod ping;
// rest/getAlbumList
mod get_album_list;
// rest/getAlbumList2
mod get_album_list2;
// rest/getAlbum
mod get_album;
// rest/stream
mod stream;
pub fn build() -> Box<dyn Endpoint<Output = poem::Response>> {
Route::new()
.at("/ping", ping::ping)
.at("/getLicense", get_license::get_license)
.at("/getMusicFolders", get_music_folders::get_music_folders)
.at("/getAlbumList", get_album_list::get_album_list)
.at("/getAlbumList2", get_album_list2::get_album_list2)
.at("/getAlbum", get_album::get_album)
.at("/stream", stream::stream)
.boxed()
}