Skip to content

Commit

Permalink
Adding Redis connectionString connection to demo app (#412)
Browse files Browse the repository at this point in the history
* Adding Redis connectionString connection to demo app

* Changing to URL

* Update demo/src/db/repository.ts

Co-authored-by: Aaron Crawfis <[email protected]>

---------

Co-authored-by: Aaron Crawfis <[email protected]>
  • Loading branch information
willdavsmith and AaronCrawfis authored Jul 19, 2023
1 parent ba6e1dc commit e90c7b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions demo/src/db/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export function createFactory(): RepositoryFactory {
return new MongoFactory(process.env.CONNECTION_MONGODB_CONNECTIONSTRING);
}

if (process.env.CONNECTION_REDIS_URL) {
console.log("Using Redis: found url in environment variable CONNECTION_REDIS_URL");
return new RedisFactory(process.env.CONNECTION_REDIS_URL);
}

if (process.env.CONNECTION_REDIS_HOST) {
console.log("Using Redis: found hostname in environment variable CONNECTION_REDIS_HOST");
const connection = {
Expand Down

0 comments on commit e90c7b8

Please sign in to comment.