quickstarts/configuration/javascript/sdk
Elena Kolevska ae812a7bf7 js sdk update
Signed-off-by: Elena Kolevska <elena@kolevska.com>
2025-02-28 17:57:40 +00:00
..
order-processor js sdk update 2025-02-28 17:57:40 +00:00
.gitignore add javascript example 2022-11-11 01:24:56 +05:30
README.md Adding sleeps and simpler mmd match condition to try and improve test reliability 2023-05-31 15:33:18 -07:00
makefile add javascript example 2022-11-11 01:24:56 +05:30

README.md

Dapr Configuration API

In this quickstart, you'll create a microservice which makes use of Dapr's Configuration API. Configuration items are key/value pairs containing configuration data such as app ids, partition keys, database names etc. The service gets configuration items from the configuration store and subscribes for configuration updates.

Visit this link for more information about Dapr and Configuration API.

This quickstart includes one service:

  • Node service order-processor

Add configuration items to the config store

Prerequisite

  • Locally running redis container - a redis container named dapr_redis is automatically created when you run dapr init
  • Open a new terminal and set values for config items orderId1 and orderId2 by using the command below
docker exec dapr_redis redis-cli MSET orderId1 "101" orderId2 "102"

Run order-processor

  1. Navigate to folder and install dependencies:
cd ./order-processor
npm install
  1. Run the Node app with Dapr:
cd ./order-processor
dapr run --app-id order-processor --resources-path ../../../components/ --app-protocol grpc --dapr-grpc-port 3500 -- node index.js

(Optional) Update value of config items

  1. Keep the order-processor app running and open a separate terminal
  2. Change the values of orderId1 and orderId2 using the command below
  3. order-processor app gets the updated values of config items
docker exec dapr_redis redis-cli MSET orderId1 "103" orderId2 "104"