From d69a6daeab9c8b52e1e077c183dc3cab19ed6555 Mon Sep 17 00:00:00 2001 From: Swrup Date: Fri, 18 Feb 2022 19:02:17 +0100 Subject: [PATCH] /babillard -> / --- src/js/js_map.ml | 4 ++-- src/permap.ml | 21 +++++++++------------ src/template.eml.html | 2 +- src/thread_page.eml.html | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/js/js_map.ml b/src/js/js_map.ml index 0a8371b..1654235 100644 --- a/src/js/js_map.ml +++ b/src/js/js_map.ml @@ -121,7 +121,7 @@ module Marker = struct let thread_preview_div = Jv.get Jv.global "thread_preview_div" in ignore @@ Jv.set thread_preview_div "innerHTML" thread_preview; let thread_link = Jv.get Jv.global "thread_link" in - let link = Format.sprintf "/babillard/%s" thread_id in + let link = Format.sprintf "/%s" thread_id in ignore @@ Jv.set thread_link "href" (Jv.of_string link); ignore @@ Jv.set thread_link "innerText" (Jv.of_string "[View Thread]"); let _ = Js_pretty_post.make_pretty () in @@ -161,7 +161,7 @@ module Marker = struct let () = log "fetch thread geojson@."; let window = Jv.get Jv.global "window" in - let link = Jv.of_string "/babillard/markers" in + let link = Jv.of_string "/markers" in let fetchfutur = Jv.call window "fetch" [| link |] in ignore @@ Jv.call fetchfutur "then" [| Jv.repr markers_handle_response |] end diff --git a/src/permap.ml b/src/permap.ml index db38195..bc28f22 100644 --- a/src/permap.ml +++ b/src/permap.ml @@ -157,7 +157,7 @@ let newthread_post request = in match res with | Ok thread_id -> - let adress = Format.asprintf "/babillard/%s" thread_id in + let adress = Format.asprintf "/%s" thread_id in Dream.respond ~status:`See_Other ~headers:[ ("Location", adress) ] "Your thread was posted!" @@ -206,7 +206,7 @@ let reply_post request = in match res with | Ok post_id -> - let adress = Format.sprintf "/babillard/%s#%s" parent_id post_id in + let adress = Format.sprintf "/%s#%s" parent_id post_id in Dream.respond ~status:`See_Other ~headers:[ ("Location", adress) ] "Your reply was posted!" @@ -217,9 +217,7 @@ let reply_post request = Dream.empty `Bad_Request ) let redirect_to_babillard _request = - Dream.respond ~status:`Moved_Permanently - ~headers:[ ("Location", "/babillard") ] - "" + Dream.respond ~status:`Moved_Permanently ~headers:[ ("Location", "/") ] "" let () = Dream.run ~secret:"yolo" ~port:3696 @@ -230,7 +228,6 @@ let () = *) @@ Dream.router [ Dream.get "/assets/**" (Dream.static ~loader:asset_loader "") - ; Dream.get "/" redirect_to_babillard ; Dream.get "/about" about ; Dream.get "/register" register_get ; Dream.post "/register" register_post @@ -243,13 +240,13 @@ let () = ; Dream.get "/profile" profile_get ; Dream.post "/profile" profile_post ; Dream.get "/thread_view/:thread_id" thread_view - ; Dream.get "/babillard/markers" markers + ; Dream.get "/markers" markers ; Dream.get "/post_pic/:post_id" post_image - ; Dream.get "/babillard" babillard_get - ; Dream.get "/babillard/new_thread" newthread_get - ; Dream.post "/babillard/new_thread" newthread_post - ; Dream.get "/babillard/:thread_id" thread_get - ; Dream.post "/reply/:thread_id" reply_post + ; Dream.get "/" babillard_get + ; Dream.get "/new_thread" newthread_get + ; Dream.post "/new_thread" newthread_post + ; Dream.get "/:thread_id" thread_get + ; Dream.post "/:thread_id" reply_post ; Dream.get "/post_pic/:post_id" post_image ] @@ Dream.not_found diff --git a/src/template.eml.html b/src/template.eml.html index c443ecd..8259bd0 100644 --- a/src/template.eml.html +++ b/src/template.eml.html @@ -19,7 +19,7 @@ let render_unsafe ~title ~content request =