1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-07-26 10:39:46 +02:00

WIP: make code compatible with new SILK API
All checks were successful
gitea-sync/antd-web-apps/pipeline/head This commit looks good

This commit is contained in:
DanyLE
2023-04-26 18:51:03 +02:00
parent 93b6ca18ad
commit a76942f2f3
60 changed files with 1527 additions and 2845 deletions

View File

@ -3,7 +3,8 @@
-- should be something like this
-- ^\/apps\/+(.*)$ = /apps/router.lua?r=<1>&<query>
-- some global variables
DIR_SEP = "/"
package.path = _SERVER["LIB_DIR"].."/lua/?.lua"
require("silk.api")
WWW_ROOT = __ROOT__.."/get"
if HEADER.Host then
HTTP_ROOT= "https://"..HEADER.Host
@ -11,16 +12,11 @@ else
HTTP_ROOT = "https://get.iohub.dev"
end
-- class path: path.to.class
BASE_FRW = ""
-- class path: path.to.class
CONTROLLER_ROOT = BASE_FRW.."get.controllers"
MODEL_ROOT = BASE_FRW.."get.models"
CONTROLLER_ROOT = "get.controllers"
MODEL_ROOT = "get.models"
-- file path: path/to/file
VIEW_ROOT = WWW_ROOT..DIR_SEP.."views"
LOG_ROOT = WWW_ROOT..DIR_SEP.."logs"
-- require needed library
require(BASE_FRW.."silk.api")
function NotfoundController:index(...)
local args = {...}
@ -32,7 +28,6 @@ function NotfoundController:index(...)
local path = WWW_ROOT..DIR_SEP.."shs"..DIR_SEP..name..".sh"
if ulib.exists(path) then
std.header("text/plain")
std.sendFile(path)
else
self:error("No script found: "..path)
@ -44,8 +39,7 @@ end
-- registry object store global variables
local REGISTRY = {}
-- set logging level
REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = false, DEBUG = false}}
REGISTRY.logger = Logger:new{ level = Logger.INFO}
REGISTRY.layout = 'default'
REGISTRY.fileaccess = false