More robust asset paths in examples (#1090)

* More robust asset paths in examples

* Update examples/low-level-rustls/src/main.rs

Co-authored-by: Jonas Platte <[email protected]>

* format

Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
David Pedersen
2022-06-15 22:42:49 +02:00
committed by GitHub
co-authored by Jonas Platte
parent cbb2e8a244
commit fd70f81c46
4 changed files with 39 additions and 19 deletions
+4 -2
View File
@@ -16,7 +16,7 @@ use axum::{
routing::{get, get_service},
Router,
};
use std::net::SocketAddr;
use std::{net::SocketAddr, path::PathBuf};
use tower_http::{
services::ServeDir,
trace::{DefaultMakeSpan, TraceLayer},
@@ -32,7 +32,9 @@ async fn main() {
))
.with(tracing_subscriber::fmt::layer())
.init();
let assets_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("assets");
let assets_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("assets");
// build our application with some routes
let app = Router::new()
.fallback(