Skip to content

This is a simple proof of concept for using Dapr with a Spin application.

Notifications You must be signed in to change notification settings

danbugs/spin-dapr-poc

Repository files navigation

spin-dapr-poc

This is a simple proof of concept for using Dapr with a Spin application.

Prerequisites

for examplary installation for Dapr CLI and Spin CLI on Ubuntu see below

Running the application

  1. Start Dapr
dapr init
  1. Build the application
spin build
  1. Start the application
dapr run --app-id spin-dapr-poc --app-port 3000 --dapr-http-port 3500 --resources-path ./components -- spin up
  1. Invoke the application
  • Using the test.http file in VS Code, or
  • Using the following curl command:
curl -v -H "dapr-app-id: spin-dapr-poc" -X GET http://localhost:3500

This app creates an entry onto a Redis statestore, and then retrieves that same entry.

The expected output should be something like this:

HTTP/1.1 200 OK
Server: fasthttp
Date: Mon, 06 Feb 2023 22:49:43 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 15
Content_type: application/json
Traceparent: 00-af6523bd51865cc5c46a89051d1684dd-20224c208faa5d9e-01
Connection: close

{
  "orderId": 257
}

Here's a video demo:

Demo

sample installation on Ubuntu 22.10

sudo apt update
sudo apt upgrade -y
sudo apt install nodejs npm -y
# install Dapr CLI
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash
dapr init
# install and configure Spin CLI
curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
sudo mv spin /usr/local/bin/
spin plugin update
spin plugin install js2wasm

About

This is a simple proof of concept for using Dapr with a Spin application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published