You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-nodejs-get-started.md
+55-4Lines changed: 55 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,8 @@ For examples of using other Node.js clients, see the individual documentation fo
30
30
Add environment variables for your **HOST NAME** and **Primary** access key. Use these variables from your code instead of including the sensitive information directly in your code.
31
31
32
32
```powershell
33
-
set AZURE_CACHE_FOR_REDIS_HOSTNAME=contosoCache
34
-
set AZURE_CACHE_FOR_REDIS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
33
+
set AZURE_CACHE_FOR_REDIS_HOST_NAME=contosoCache
34
+
set AZURE_CACHE_FOR_REDIS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
35
35
```
36
36
37
37
## Connect to the cache
@@ -49,7 +49,58 @@ The latest builds of [node_redis](https://github.com/mranney/node_redis) provide
49
49
50
50
1. Add the following example JavaScript to the file.
This code shows you how to connect to an Azure Cache forRedis instance using the cache host name and key environment variables. The code also stores and retrieves a string valuein the cache. The `PING` and `CLIENT LIST` commands are also executed. For more examples of using Redis with the [node_redis](https://github.com/mranney/node_redis) client, see [https://redis.js.org/](https://redis.js.org/).
55
106
@@ -76,7 +127,7 @@ The latest builds of [node_redis](https://github.com/mranney/node_redis) provide
76
127
Cache response : Hello! The cache is working from Node.js!
0 commit comments