Mercurial Hosting > chat
view src/private/tools/save_config.txt.luan @ 1:b116b6ef07bf
add config
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 23 Oct 2024 21:18:04 -0600 |
parents | |
children | e229f4aacde0 |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local parse = Luan.parse or error() local stringify = Luan.stringify or error() local Io = require "luan:Io.luan" local uri = Io.uri or error() local Http = require "luan:http/Http.luan" local Shared = require "site:/lib/Shared.luan" local config_file = Shared.config_file or error() return function() local config = Http.request.parameters.config or error() config = parse(config) uri("site:/private/local/").mkdir() config_file.write_text(stringify(config).."\n") Http.reset_luan() Io.stdout = Http.response.text_writer() %>saved<% end