local Luan = require "luan:Luan.luan" local error = Luan.error local do_file = Luan.do_file or error() local stringify = Luan.stringify or error() local Io = require "luan:Io.luan" local Http = require "luan:http/Http.luan" local file = Io.uri "site:/local/config.luan" if not file.exists() then file.parent().mkdir() file.write("return {}\n") end return function() if Http.request.method == "POST" then local config = Http.request.parameters file.write("return "..stringify(config).."\n") Http.response.send_redirect "config.html" return end local config = do_file(file) Io.stdout = Http.response.text_writer() %>

config

<% local function field(name) %>

<%= name %>: ">

<% end field "a" field "b" field "c" %>

<% end