Skip to content
app.routes 612 B
Newer Older
theMackabu's avatar
theMackabu committed
index {
theMackabu's avatar
theMackabu committed
   text(":3\nwelcome to the root")
}

hello() {
   text("Hello World!")
}

theMackabu's avatar
theMackabu committed
example() {
theMackabu's avatar
theMackabu committed
   html(http::get("https://example.org"))
theMackabu's avatar
theMackabu committed
}

example/json() {
theMackabu's avatar
theMackabu committed
   text(http::get("https://httpbin.org//json"))
theMackabu's avatar
theMackabu committed
}
theMackabu's avatar
theMackabu committed

theMackabu's avatar
theMackabu committed
test.json() {
theMackabu's avatar
theMackabu committed
   let res = #{
       hello: "world",
       info: #{
         path: path,
         url: url,
         ver: ver,
         query: query,
       }
   };
   
   json(res)
}

test/loadfile() {
   let file = open_file("test.html");
   html(file.read_string())
}

theMackabu's avatar
theMackabu committed
// remove to test 404 route
theMackabu's avatar
theMackabu committed
* {
   text("this is a wildcard route\ncurrently on: " + path)
theMackabu's avatar
theMackabu committed
}

404 {
   text("404 page\n\n" + err)