Skip to content

0riginaln0/astra-trails

Repository files navigation

Astra Trails

Examples, hacks & tricks around Astra - a web server runtime for Lua.

server:get("/sunny-day", logger(html(sunny_day)))
server:get("/normal-day", chain { logger, html } (normal_day))
server:get("/favourite-day", chain { ctx, logger, insert_datetime, html } (favourite_day))
Routes(server) {
    base_middleware = ctx,
    { "GET",         "/",       homepage },
    { "POST",        "/",       add_homepage_info },
    { "GET",         "/hi",     just_hi },
    { "STATIC_FILE", "/main",   "main.lua" },
    { "STATIC_DIR",  "/public", "public" },
    scope "/api" {            
        scope "/v1" {
            { "GET", "/favlangs", favlangs },
        },
        scope "/v2" {
            base_middleware = html,
            { "GET", "/favlangs", favlangs2 },
        },
    },
}

  • Quickstart: The Trails project template. The archived template can be downloaded directly from the releases

About

Examples, hacks & tricks around Astra - a web server runtime for Lua.

Resources

Stars

Watchers

Forks

Packages

No packages published