what the fuck OpenResty
This commit is contained in:
+2
-1
@@ -3,5 +3,6 @@ local config = require("lapis.config")
|
||||
config("development", {
|
||||
server = "nginx",
|
||||
code_cache = "off",
|
||||
num_workers = "1"
|
||||
num_workers = "1",
|
||||
port = "8080",
|
||||
})
|
||||
|
||||
@@ -22,6 +22,7 @@ http {
|
||||
default_type text/html;
|
||||
content_by_lua_block {
|
||||
require("lapis").serve("app")
|
||||
-- require("path_fix")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
-- WARNING this works in LuaJIT but fails in OpenResty; it somehow ignores the path
|
||||
|
||||
-- there is no way to find the correct load path / current user from OpenResty
|
||||
local CODE_PATH = "/Users/tangent/.luarocks/share/lua/5.1/"
|
||||
|
||||
local lapis
|
||||
local success, error_message = pcall(function() return require("lapis") end)
|
||||
|
||||
if success then
|
||||
lapis = error_message
|
||||
else
|
||||
package.path = package.path .. ";" .. CODE_PATH .. "?.lua;" .. CODE_PATH .. "?/init.lua"
|
||||
lapis = require("lapis")
|
||||
end
|
||||
|
||||
lapis.serve("app")
|
||||
Reference in New Issue
Block a user