start resty port to lapis

This commit is contained in:
2025-11-06 16:37:55 +01:00
commit 8ab812dce0
14 changed files with 878 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
local to_json = require("lapis.util").to_json
local autoload = require("lapis.util").autoload
local config = require("lapis.config")
-- print(to_json(config.get()))
local hotmixes = autoload("hotmixes")
local function Roothandler(self)
local stuff = hotmixes.utils.these_files( hotmixes.utils.data_path )
local latest_path, latest_name = hotmixes.utils.these_latest()
self.total = hotmixes.utils.total_files_dir( config.get().mount )
self.uri = hotmixes.utils.request_path
self.path = '/data' .. hotmixes.utils.request_path
self.dirs = stuff.dirs
self.files = stuff.files
self.images = stuff.images
self.latestpath = latest_path
self.latestname = latest_name
return { render = "root" }
end
return Roothandler