Skip to content

Latest commit

 

History

History

dapr

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

NanoBus + Dapr

Use NanoBus and Dapr together to simplify cloud application development.

Prerequisites

Before you begin, make sure you have the following installed:

  1. Clone the nanobus/examples directory

    git clone https://github.com/nanobus/examples.git
    cd examples/dapr
    
  2. Run NanoBus and Dapr.

    dapr run --app-id hello-world --app-port 19090 --app-protocol grpc -- nanobus run --debug --developer-mode bus.ts

Invoking the service

The service stores people and publishes welcome events when they are created.

Data objects are stored using Dapr's State Store API and events are published via the PubSub API. This example is designed to use Redis image that is started in Docker via dapr init.

Save person in state store and publish welcome event

curl -L -X POST 'http://localhost:8080/people' \
-H 'Content-Type: application/json' \
--data-raw '{
    "id": "1234",
    "firstName": "John",
    "lastName": "Doe"
}'

Retrieve person from state store

curl -L -X GET 'http://localhost:8080/people/1234'

More info

For more info, visit the NanoBus github repo.