I was using .env files, to read all the configurations, now I want to read all my configurations from the consul
at runtime.
const consulServer = consul({
host: 'my-host',
port:123,
})
consulServer.kv.get('url', (err: any, response: { Value: any }) => {
if (!err && response.Value) {
console.log(response.Value)
} else {
console.log('Failed to load consul configuration', err)
}
})
I am running CONSUl and react app on my local in different ports, but while reading the consul I am getting cors
error
any help here much appreciated
You can configure server-side HTTP headers for CORS under Consul's
http_config.response_headers
configuration option.HCL
JSON