diff --git a/Slon/Endpoints/Get/Web.HC b/Slon/Endpoints/Get/Web.HC index 625880b..e373d5e 100644 --- a/Slon/Endpoints/Get/Web.HC +++ b/Slon/Endpoints/Get/Web.HC @@ -4,13 +4,22 @@ if (String.EndsWith(".css", session->path())) { return; } +if (!StrICmp("/json/about.json", session->path())) { + JsonArray* about = Json.CreateArray(session->mem_task); + about->append(Json.CreateObject(session->mem_task), JSON_OBJECT); + about->o(0)->set("url", "_About this instance", JSON_STRING); + about->o(0)->set("content", db->o("settings")->@("about_page_content"), JSON_STRING); + session->send(about); + return; +} + if (!StrICmp("/js/header.js", session->path())) { session->content_type("text/javascript"); @slon_http_send_file(session, "M:/Slon/Static/js/header.js"); return; } -if (String.EndsWith(".js", session->path())) { +if (!StrICmp("/js/statuses.js", session->path())) { session->content_type("text/javascript"); @slon_http_send_file(session, "M:/Slon/Static/js/statuses.js"); return; @@ -20,3 +29,16 @@ if (String.BeginsWith("/@", session->path())) { @slon_web_user_get(session); return; } + +if (!StrICmp("/about", session->path())) { + @slon_http_send_file(session, "M:/Slon/Static/html/about.html"); + return; +} + +if (!StrICmp("/", session->path()) || !StrICmp("/index.html", session->path())) { + session->header("Location", "/about"); + session->status(302); + return; +} + +//