mirror of
https://github.com/OpenBankProject/API-Explorer-II.git
synced 2026-02-06 18:56:58 +00:00
feature/Add VITE_OBP_REDIS_USERNAME env property
This commit is contained in:
parent
054279f63c
commit
77f5651fc6
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "api-explorer",
|
||||
"version": "1.0.20",
|
||||
"version": "1.0.21",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite & ts-node server/app.ts",
|
||||
|
||||
@ -44,15 +44,25 @@ process.env.VITE_OBP_REDIS_URL
|
||||
? console.log(`VITE_OBP_REDIS_URL: ${process.env.VITE_OBP_REDIS_URL}`)
|
||||
: console.log(`VITE_OBP_REDIS_URL: undefined connects to localhost on port 6379`)
|
||||
|
||||
const redisPassword = process.env.VITE_OBP_REDIS_PASSWORD
|
||||
const redisPassword = process.env.VITE_OBP_REDIS_PASSWORD
|
||||
? process.env.VITE_OBP_REDIS_PASSWORD // Redis instance is protected with a password
|
||||
: '' // Specify an empty password (i.e., no password) when connecting to Redis
|
||||
if(!redisPassword) {
|
||||
if (!redisPassword) {
|
||||
console.warn(`VITE_OBP_REDIS_PASSWORD is not provided.`)
|
||||
}
|
||||
const redisUsername = process.env.VITE_OBP_REDIS_USERNAME
|
||||
? process.env.VITE_OBP_REDIS_USERNAME // Redis instance is protected with a username/password
|
||||
: '' // Specify an empty username (i.e., no username) when connecting to Redis
|
||||
if (!redisUsername) {
|
||||
console.warn(`VITE_OBP_REDIS_USERNAME is not provided.`)
|
||||
}
|
||||
console.log(`-----------------------------------------------------------------`)
|
||||
const redisClient = process.env.VITE_OBP_REDIS_URL
|
||||
? createClient({ url: process.env.VITE_OBP_REDIS_URL, password: redisPassword })
|
||||
? createClient({
|
||||
url: process.env.VITE_OBP_REDIS_URL,
|
||||
username: redisUsername,
|
||||
password: redisPassword
|
||||
})
|
||||
: createClient()
|
||||
redisClient.connect().catch(console.error)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user