This is another example of a Lua server page, served by CivetWeb web server.

The following features are available:

" .. name .. "\n") end end function recurse(tab) mg.write("

\n") for k,v in pairs(tab) do if type(v) == "table" then mg.write("
- " .. tostring(k) .. ":
\n") recurse(v) else mg.write("
- " .. tostring(k) .. " = " .. tostring(v) .. "
\n") end end mg.write("

\n") end ?> " .. _VERSION .. " with the following standard libraries\n") mg.write("

") libs = {"string", "math", "table", "io", "os", "bit32", "utf8", "package", "coroutine", "debug"}; for _,n in ipairs(libs) do print_if_available(_G[n], n); end mg.write("

\n") print_if_available(sqlite3, "sqlite3 binding") print_if_available(lfs,"lua file system") -- Print mg library libname = "mg" print_if_available(_G[libname], libname .. " library") recurse(_G[libname]) -- Print connect function print_if_available(connect, "connect function") ?>

Today is

\n") for f in lfs.dir(".") do mg.write("

- " .. f .. "
\n") local at = lfs.attributes(f); recurse(at) end mg.write("\n") end ?>