Browse Source

Merge pull request #1576 from torhve/improve-lapis

Lua: Disable lapis logging + update db settings
Hamilton Turner 10 years ago
parent
commit
a508ae3a0a

+ 13 - 12
frameworks/Lua/lapis/config.lua

@@ -1,18 +1,19 @@
 local config
 local config
-do
-  local _obj_0 = require("lapis.config")
-  config = _obj_0.config
-end
+config = require("lapis.config").config
 config("development", function() end)
 config("development", function() end)
-return config("production", function()
+return config({
+  "production",
+  "development"
+}, function()
   port(80)
   port(80)
   num_workers(4)
   num_workers(4)
   lua_code_cache("on")
   lua_code_cache("on")
-  return postgres({
-    backend = "pgmoon",
-    database = "hello_world",
-    user = "benchmarkdbuser",
-    password = "benchmarkdbpass",
-    host = "DBHOSTNAME"
-  })
+  logging(false)
+  return postgres(function()
+    backend("pgmoon")
+    database("hello_world")
+    user("benchmarkdbuser")
+    password("benchmarkdbpass")
+    return host("DBHOSTNAME")
+  end)
 end)
 end)

+ 8 - 8
frameworks/Lua/lapis/config.moon

@@ -2,14 +2,14 @@ import config from require "lapis.config"
 
 
 config "development", ->
 config "development", ->
 
 
-config "production", ->
+config {"production", "development"}, ->
   port 80
   port 80
   num_workers 4
   num_workers 4
   lua_code_cache "on"
   lua_code_cache "on"
-  postgres {
-    backend: "pgmoon"
-    database: "hello_world"
-    user: "benchmarkdbuser"
-    password: "benchmarkdbpass"
-    host: "DBHOSTNAME"
-  }
+  logging false
+  postgres ->
+    backend "pgmoon"
+    database "hello_world"
+    user "benchmarkdbuser"
+    password "benchmarkdbpass"
+    host "DBHOSTNAME"

+ 1 - 2
frameworks/Lua/lapis/nginx.conf

@@ -1,6 +1,6 @@
     worker_processes auto;
     worker_processes auto;
 #    pid        /tmp/nginx.pid;
 #    pid        /tmp/nginx.pid;
-    error_log stderr crit;
+    error_log stderr notice;
     #error_log /tmp/test.log error;
     #error_log /tmp/test.log error;
     env LAPIS_ENVIRONMENT;
     env LAPIS_ENVIRONMENT;
     daemon off;
     daemon off;
@@ -26,7 +26,6 @@
 
 
             location / {
             location / {
                 default_type text/html;
                 default_type text/html;
-                set $_url "";
                 content_by_lua_file "loader.lua";
                 content_by_lua_file "loader.lua";
             }
             }