Skip to content

Commit

Permalink
Rename image api route
Browse files Browse the repository at this point in the history
  • Loading branch information
Insprill committed Nov 20, 2022
1 parent b7b9b78 commit 6d81a44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct UrlQuery {
}

#[get("/api/image")]
pub async fn api(info: web::Query<UrlQuery>) -> impl Responder {
pub async fn image(info: web::Query<UrlQuery>) -> impl Responder {
// Ensure this can't be abused.
let img_path = &info.url.split('/').last().unwrap_or_default();
let (status, body) = genius::request(genius::SubDomain::Images, img_path, None).await;
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn main() -> std::io::Result<()> {
.add(("Content-Security-Policy", "default-src 'self'")),
)
// Routes
.service(api::api)
.service(api::image)
.service(artist::artist)
.service(home::home)
.service(lyrics::lyrics)
Expand Down

0 comments on commit 6d81a44

Please sign in to comment.