Skip to content

Commit 79ba7ee

Browse files
committed
fix(serve): static file at root path
1 parent f17520b commit 79ba7ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ async fn main() {
5757
.body(playground_source(GraphQLPlaygroundConfig::new("/query")))
5858
});
5959

60-
let static_files = warp::path("static").and(warp::fs::dir(opt.static_file_path));
60+
let static_files = warp::get().and(warp::fs::dir(opt.static_file_path));
6161

62-
let routes = graphql_playground.or(static_files).or(graphql_post);
62+
let routes = graphql_playground.or(graphql_post).or(static_files);
6363

6464
warp::serve(routes).run(([0, 0, 0, 0], 8000)).await;
6565
}

0 commit comments

Comments
 (0)