leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.12k stars 247 forks source link

Unable to modify config #702

Closed o-rey closed 4 years ago

o-rey commented 4 years ago

Here's my app code:

local lapis = require("lapis")
local app = lapis.Application()

local config = require("lapis.config")

config("development", {
  port = 443
})

app:get("/", function()
  return "ENV is " .. config.get()._name .. " PORT is " .. config.get().port
end)

return app

Result is

ENV is development PORT is 8080

So the value is unchanged.

Tried to change any other variable - still no luck.

What am I doing wrong?

openresty/1.17.8.2

o-rey commented 4 years ago

hmmm sorry my bad. found the issue