Cannot access assets served via AXUM ServeDir
mystique09
HOBBYOP

a year ago

gamefiles.rs

use std::sync::Arc;

use axum::Router;
use repository::user_repository::UserRepository;
use tower_http::services::ServeDir;

pub fn build_game_files_router<u>(_user_repository: Arc<u>) -&gt; Router
where
    U: UserRepository,
{
    Router::new().nest_service("/", ServeDir::new(r#"assets\gamefiles"#))
}

api.rs

        let router = Router::new()
            .nest("/api/v1/users", user_router)
            .nest("/api/v1/auth", auth_router)
            .nest("/api/v1/game", game_router)
            .nest("/gamefiles", gamefiles_router)
//...

/gamefiles/ is not accessible, this work on my local machine

Solved

4 Replies

mystique09
HOBBYOP

a year ago

lol


mystique09
HOBBYOP

a year ago

8834469a-e548-46f2-b162-35d11d49dd3f


mystique09
HOBBYOP

a year ago

closing this, assets\gamefiles is not working on linux, it should be assets/gamefiles


a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...