quickstarts/bindings/go/http/README.md

1.9 KiB

Dapr Bindings (HTTP)

In this quickstart, you'll create a microservice to demonstrate Dapr's bindings API to work with external systems as inputs and outputs. The service listens to input binding events from a system CRON and then outputs the contents of local data to a PostreSql output binding.

Visit this link for more information about Dapr and Bindings.

Note: This example leverages only HTTP REST. If you are looking for the example using the Dapr SDK click here.

This quickstart includes one service:

  • Go service app

Run and initialize PostgreSQL container

  1. Open a new terminal, change directories to ../../db, and run the container with Docker Compose:
cd ../../db
docker compose up

Run Go service with Dapr

  1. Open a new terminal, change directories to ./batch in the quickstart directory and run:
cd ./batch
go build .
  1. Run the Go service app with Dapr:
dapr run --app-id batch-http --app-port 6003 --dapr-http-port 3503 --dapr-grpc-port 60003 --resources-path ../../../components -- go run .