dispatcher.lua

来自「cgi for lua, you can build your personal」· LUA 代码 · 共 18 行

LUA
18
字号
module(..., package.seeall)-- inferred_name refers to the name of the launcher without the extension-- It can be used to set cgilua.script_path to a bootstrap file named-- after the launcher name utilized in the URL_, inferred_name = cgilua.splitpath(cgilua.servervariable("SCRIPT_NAME"))inferred_name = string.gsub(inferred_name, "%.[^%.]-$","")-- Maps a URL prefix into a filepath to be used as a bootstrapperfunction map(prefix, filepath)  local p_info = cgilua.servervariable("PATH_INFO") or ""  local prefix = "^" .. prefix  if p_info:find(prefix) then     script_name = path     cgilua.script_path = script_name     path_info = string.gsub(p_info, prefix, "")  endend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?