diff --git a/config.moon b/config.moon index aab3f47..78978df 100644 --- a/config.moon +++ b/config.moon @@ -1,5 +1,13 @@ config = require "lapis.config" +ffi = actualrequire("ffi") +ffi.cdef [[ + char *getenv(const char *name) +]] + +getenv = (name) -> + ffi.string ffi.C.getenv name + config "development", -> port 8080 @@ -15,8 +23,8 @@ config "docker", -> postgres -> backend "pgmoon" - port os.getenv "POSTGRESQL_PORT_5432_TCP_PORT" - host os.getenv "POSTGRESQL_PORT_5432_TCP_ADDR" - user os.getenv "DB_USER" - password os.getenv "DB_PASS" - database os.getenv "DB_NAME" + port getenv "POSTGRESQL_PORT_5432_TCP_PORT" + host getenv "POSTGRESQL_PORT_5432_TCP_ADDR" + user getenv "DB_USER" + password getenv "DB_PASS" + database getenv "DB_NAME" diff --git a/nginx.conf b/nginx.conf index 67a131f..d43a8a4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -16,6 +16,7 @@ http { location / { default_type text/html; content_by_lua ' + actualrequire = require require = require"require".require require("moonscript") require("lapis").serve("app")