diff --git a/src/endpoints/index.js b/src/endpoints/index.js index 521ed85..882eae6 100644 --- a/src/endpoints/index.js +++ b/src/endpoints/index.js @@ -29,7 +29,7 @@ submit.addEventListener("click", async () => { try { showStatus("Generiere..."); - const response = await fetch("/", { + const response = await fetch(".", { method: "post", body: new URLSearchParams(data), }); diff --git a/src/endpoints/index.rs b/src/endpoints/index.rs index a8ca7e1..4f9900a 100644 --- a/src/endpoints/index.rs +++ b/src/endpoints/index.rs @@ -30,7 +30,7 @@ pub async fn get() -> Markup { "Want to use " a href="https://github.com/kit-sdq/TimeSheetGenerator" { "TimeSheetGenerator" } "-compatible JSON instead? " - a href="/tsg" { "Go here!" } + a href="tsg/" { "Go here!" } } div #header { diff --git a/src/endpoints/tsg.js b/src/endpoints/tsg.js index 6e8f490..08f6983 100644 --- a/src/endpoints/tsg.js +++ b/src/endpoints/tsg.js @@ -33,7 +33,7 @@ submit.addEventListener("click", async () => { try { showStatus("Generiere..."); - const response = await fetch("/tsg", { + const response = await fetch(".", { method: "post", headers: { "Content-Type": "application/json" }, body: dataJson, diff --git a/src/endpoints/tsg.rs b/src/endpoints/tsg.rs index 7f5f019..1ae4486 100644 --- a/src/endpoints/tsg.rs +++ b/src/endpoints/tsg.rs @@ -23,7 +23,7 @@ pub async fn get() -> Markup { p { "Want to use a fancy-looking form instead? " - a href="/" { "Go here!" } + a href=".." { "Go here!" } } textarea name="global" placeholder="Global.json" {} diff --git a/src/main.rs b/src/main.rs index 28a3466..d7bfa49 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ async fn main() -> anyhow::Result<()> { let app = Router::<()>::new() .route("/", get(endpoints::index::get).post(endpoints::index::post)) - .route("/tsg", get(endpoints::tsg::get).post(endpoints::tsg::post)); + .route("/tsg/", get(endpoints::tsg::get).post(endpoints::tsg::post)); let listener = TcpListener::bind(args.addr).await?; axum::serve(listener, app).await?;