Skip to content
Snippets Groups Projects
app.routes 599 B
Newer Older
  • Learn to ignore specific revisions
  • 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() {
       html(get("https://example.org"))
    }
    
    example/json() {
       json(get("https://httpbin.org/json"))
    }
    
    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)