Created
April 16, 2021 06:58
-
-
Save adamjakab/f5446b53eb07db0a3b8676110521c8a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Created by IntelliJ IDEA. | |
-- User: jackisback | |
-- Date: 15/04/2021 | |
-- Time: 23.20 | |
-- To change this template use File | Settings | File Templates. | |
-- | |
-- Reference: | |
-- https://github.com/openresty/lua-nginx-module#data-sharing-within-an-nginx-worker | |
-- This module needs to be loaded by the `require()` builtin like this: | |
-- location /something { | |
-- content_by_lua_block { | |
-- local cfgLoader = require "/path/to/configLoaderModule" | |
-- local cfg = cfgLoader.get() | |
-- ngx.say("Config: " .. cfg) | |
-- } | |
-- } | |
local _M = {} | |
local integrationConfigFilePath = "/opt/openresty/nginx/lua_scripts/external_data_loader/config.json" | |
local integrationConfigFile = io.open(integrationConfigFilePath, "r") | |
local integrationConfigJson = integrationConfigFile:read("*a") | |
integrationConfigFile:close() | |
function _M.get() | |
return integrationConfigJson | |
end | |
return _M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment