Browse Source

Use CWD for full path to web.lua. Recompile lua.

Tor Hveem 11 years ago
parent
commit
a26bdf0ed1
3 changed files with 34 additions and 34 deletions
  1. 2 2
      lapis/config.lua
  2. 1 1
      lapis/nginx.conf
  3. 31 31
      lapis/web.lua

+ 2 - 2
lapis/config.lua

@@ -1,7 +1,7 @@
 local config
 local config
 do
 do
-  local _table_0 = require("lapis.config")
-  config = _table_0.config
+  local _obj_0 = require("lapis.config")
+  config = _obj_0.config
 end
 end
 config("development", function()
 config("development", function()
   return postgresql_url("postgres://benchmarkdbuser:[email protected]/hello_world")
   return postgresql_url("postgres://benchmarkdbuser:[email protected]/hello_world")

+ 1 - 1
lapis/nginx.conf

@@ -24,7 +24,7 @@ http {
         location / {
         location / {
             default_type text/html;
             default_type text/html;
             set $_url "";
             set $_url "";
-            content_by_lua_file "web.lua";
+            content_by_lua_file "CWD/web.lua";
         }
         }
 
 
         location /static/ {
         location /static/ {

+ 31 - 31
lapis/web.lua

@@ -2,30 +2,38 @@ local lapis = require("lapis")
 local db = require("lapis.db")
 local db = require("lapis.db")
 local Model
 local Model
 do
 do
-  local _table_0 = require("lapis.db.model")
-  Model = _table_0.Model
+  local _obj_0 = require("lapis.db.model")
+  Model = _obj_0.Model
 end
 end
 local config
 local config
 do
 do
-  local _table_0 = require("lapis.config")
-  config = _table_0.config
+  local _obj_0 = require("lapis.config")
+  config = _obj_0.config
+end
+local insert
+do
+  local _obj_0 = table
+  insert = _obj_0.insert
+end
+local sort
+do
+  local _obj_0 = table
+  sort = _obj_0.sort
+end
+local random
+do
+  local _obj_0 = math
+  random = _obj_0.random
 end
 end
-local insert = table.insert
-local sort = table.sort
-local random = math.random
 local Fortune
 local Fortune
 do
 do
   local _parent_0 = Model
   local _parent_0 = Model
   local _base_0 = { }
   local _base_0 = { }
   _base_0.__index = _base_0
   _base_0.__index = _base_0
-  if _parent_0 then
-    setmetatable(_base_0, _parent_0.__base)
-  end
+  setmetatable(_base_0, _parent_0.__base)
   local _class_0 = setmetatable({
   local _class_0 = setmetatable({
     __init = function(self, ...)
     __init = function(self, ...)
-      if _parent_0 then
-        return _parent_0.__init(self, ...)
-      end
+      return _parent_0.__init(self, ...)
     end,
     end,
     __base = _base_0,
     __base = _base_0,
     __name = "Fortune",
     __name = "Fortune",
@@ -33,7 +41,7 @@ do
   }, {
   }, {
     __index = function(cls, name)
     __index = function(cls, name)
       local val = rawget(_base_0, name)
       local val = rawget(_base_0, name)
-      if val == nil and _parent_0 then
+      if val == nil then
         return _parent_0[name]
         return _parent_0[name]
       else
       else
         return val
         return val
@@ -46,7 +54,7 @@ do
     end
     end
   })
   })
   _base_0.__class = _class_0
   _base_0.__class = _class_0
-  if _parent_0 and _parent_0.__inherited then
+  if _parent_0.__inherited then
     _parent_0.__inherited(_parent_0, _class_0)
     _parent_0.__inherited(_parent_0, _class_0)
   end
   end
   Fortune = _class_0
   Fortune = _class_0
@@ -56,14 +64,10 @@ do
   local _parent_0 = Model
   local _parent_0 = Model
   local _base_0 = { }
   local _base_0 = { }
   _base_0.__index = _base_0
   _base_0.__index = _base_0
-  if _parent_0 then
-    setmetatable(_base_0, _parent_0.__base)
-  end
+  setmetatable(_base_0, _parent_0.__base)
   local _class_0 = setmetatable({
   local _class_0 = setmetatable({
     __init = function(self, ...)
     __init = function(self, ...)
-      if _parent_0 then
-        return _parent_0.__init(self, ...)
-      end
+      return _parent_0.__init(self, ...)
     end,
     end,
     __base = _base_0,
     __base = _base_0,
     __name = "World",
     __name = "World",
@@ -71,7 +75,7 @@ do
   }, {
   }, {
     __index = function(cls, name)
     __index = function(cls, name)
       local val = rawget(_base_0, name)
       local val = rawget(_base_0, name)
-      if val == nil and _parent_0 then
+      if val == nil then
         return _parent_0[name]
         return _parent_0[name]
       else
       else
         return val
         return val
@@ -84,7 +88,7 @@ do
     end
     end
   })
   })
   _base_0.__class = _class_0
   _base_0.__class = _class_0
-  if _parent_0 and _parent_0.__inherited then
+  if _parent_0.__inherited then
     _parent_0.__inherited(_parent_0, _class_0)
     _parent_0.__inherited(_parent_0, _class_0)
   end
   end
   World = _class_0
   World = _class_0
@@ -168,14 +172,10 @@ return lapis.serve((function()
       end
       end
     }
     }
     _base_0.__index = _base_0
     _base_0.__index = _base_0
-    if _parent_0 then
-      setmetatable(_base_0, _parent_0.__base)
-    end
+    setmetatable(_base_0, _parent_0.__base)
     local _class_0 = setmetatable({
     local _class_0 = setmetatable({
       __init = function(self, ...)
       __init = function(self, ...)
-        if _parent_0 then
-          return _parent_0.__init(self, ...)
-        end
+        return _parent_0.__init(self, ...)
       end,
       end,
       __base = _base_0,
       __base = _base_0,
       __name = "Benchmark",
       __name = "Benchmark",
@@ -183,7 +183,7 @@ return lapis.serve((function()
     }, {
     }, {
       __index = function(cls, name)
       __index = function(cls, name)
         local val = rawget(_base_0, name)
         local val = rawget(_base_0, name)
-        if val == nil and _parent_0 then
+        if val == nil then
           return _parent_0[name]
           return _parent_0[name]
         else
         else
           return val
           return val
@@ -196,7 +196,7 @@ return lapis.serve((function()
       end
       end
     })
     })
     _base_0.__class = _class_0
     _base_0.__class = _class_0
-    if _parent_0 and _parent_0.__inherited then
+    if _parent_0.__inherited then
       _parent_0.__inherited(_parent_0, _class_0)
       _parent_0.__inherited(_parent_0, _class_0)
     end
     end
     Benchmark = _class_0
     Benchmark = _class_0