Mercurial Hosting > chat
view src/private/tools/save_config.txt.luan @ 66:f067de76084c
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 06 Mar 2025 03:09:24 -0700 |
parents | b116b6ef07bf |
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