Hash :
23157d69
Author :
Thomas de Grivel
Date :
2025-08-02T13:32:32
add uptime to test_httpd in /system
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
def HTTPd.routes = []
def_route("/", DocController.route)
# def_route("/fx/", FXController.fx_route)
# def_route("/tags/", FXController.tags_route)
# def_route("/properties/", FXController.properties_route)
# def_static_route("/file", "./fx/", 1)
def_route("/sitemap.xml", SitemapController.route)
def_route("/system", SystemController.route)
def_route("/", PageController.route)
HTTPd.Route.def_static_route("", "./static/", 0)
defmodule Route do
def doc = fn (path, locale) {
if List.has?(Config.available_locales, locale) do
"/#{URL.escape(locale)}#{URL.escape(path)}"
else
URL.escape(path)
end
}
def locale = fn (url, url_locale, locale) {
if Str.starts_with?(url, "/#{url_locale}") do
url = Str.slice(url, Str.size(url_locale) + 1, -1)
end
if List.has?(Config.available_locales, locale) do
"/#{URL.escape(locale)}#{URL.escape(url)}"
else
URL.escape(url)
end
}
end