mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add standard favicon endpoint
This commit is contained in:
@@ -59,6 +59,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.service(robocraft::registration::form_submit)
|
||||
.service(robocraft::registration::form_load)
|
||||
.service(robocraft::registration::favicon)
|
||||
.service(robocraft::registration::favicon_standard)
|
||||
.service(robocraft::email::email_password_auth)
|
||||
.service(robocraft::steam::steam_auth)
|
||||
.service(robocraft::username::user_password_auth)
|
||||
|
||||
@@ -190,8 +190,17 @@ pub async fn form_load(handlebars_ref: Data<handlebars::Handlebars<'_>>) -> Html
|
||||
}, &handlebars_ref)
|
||||
}
|
||||
|
||||
#[get("/robocraft/favicon")]
|
||||
pub async fn favicon(config: Data<super::RcConfig>) -> impl Responder {
|
||||
async fn favicon_impl(config: Data<super::RcConfig>) -> impl Responder {
|
||||
let path = config.assets.join("favicon.jpg");
|
||||
actix_files::NamedFile::open_async(path).await
|
||||
}
|
||||
|
||||
#[get("/robocraft/favicon")]
|
||||
pub async fn favicon(config: Data<super::RcConfig>) -> impl Responder {
|
||||
favicon_impl(config).await
|
||||
}
|
||||
|
||||
#[get("/favicon.ico")]
|
||||
pub async fn favicon_standard(config: Data<super::RcConfig>) -> impl Responder {
|
||||
favicon_impl(config).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user