lapis配置之 lua語法

NO IMAGE

Lua

這將產生以下兩個配置結果(預設值省略):

-- "development"
{
host = "example.com",
email_enabled = false,
postgres = {
host = "localhost",
port = "5432",
database = "my_app",
},
_name = "development"
}

-- "production"
{
host = "example.com",
email_enabled = true,
postgres = {
host = "localhost",
port = "5432",
database = "my_app_prod"
},
_name = "production"
}

您可以在相同的配置名稱上呼叫 config 函式多次,每次將傳入的表合併到配置中。