geqintan commited on
Commit
f228688
·
1 Parent(s): bc53247
Files changed (2) hide show
  1. app.lua +2 -29
  2. app/v1/app.lua +2 -1
app.lua CHANGED
@@ -29,32 +29,5 @@ ngx.say("pass_url: ", pass_url)
29
  -- require(lua_path)
30
  local lua_path = "app/" ..api_version .. "/app"
31
  ngx.say("lua_path: ", lua_path)
32
- require(lua_path)
33
-
34
- -- local lfs = require("lfs")
35
- -- -- 获取当前工作目录
36
- -- local current_dir = lfs.currentdir()
37
- -- ngx.say("Current directory:", current_dir)
38
- -- -- 列举当前目录的内容
39
- -- for file in lfs.dir(current_dir) do
40
- -- if file ~= "." and file ~= ".." then -- 排除 "." 和 ".."
41
- -- local path = current_dir .. "/" .. file
42
- -- local attr = lfs.attributes(path) -- 获取文件属性
43
-
44
- -- if attr.mode == "directory" then
45
- -- print("Directory:", file)
46
- -- elseif attr.mode == "file" then
47
- -- print("File:", file)
48
- -- else
49
- -- print("Other:", file)
50
- -- end
51
- -- end
52
- -- end
53
-
54
-
55
- -- local status, err = pcall(require, lua_path)
56
- -- if not status then
57
- -- ngx.log(ngx.ERR, "failed to load lua file: ", lua_path, ", error: ", err)
58
- -- ngx.say("Error: Failed to load API version: ", api_version)
59
- -- ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
60
- -- end
 
29
  -- require(lua_path)
30
  local lua_path = "app/" ..api_version .. "/app"
31
  ngx.say("lua_path: ", lua_path)
32
+ model_v = require(lua_path)
33
+ ngx.say("model_v.a: ", model_v.a)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/v1/app.lua CHANGED
@@ -1 +1,2 @@
1
- ngx.say("version: v1")
 
 
1
+ ngx.say("version: v1")
2
+ a = 1