https://github.com/danbugs/spin-dapr-poc
This is a simple proof of concept for using Dapr with a Spin application.
https://github.com/danbugs/spin-dapr-poc
dapr spin
Last synced: 2 months ago
JSON representation
This is a simple proof of concept for using Dapr with a Spin application.
- Host: GitHub
- URL: https://github.com/danbugs/spin-dapr-poc
- Owner: danbugs
- Created: 2023-02-06T22:44:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-24T17:49:28.000Z (about 3 years ago)
- Last Synced: 2025-03-12T03:33:42.549Z (over 1 year ago)
- Topics: dapr, spin
- Language: TypeScript
- Homepage:
- Size: 50.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## spin-dapr-poc
This is a simple proof of concept for using Dapr with a Spin application.
### Prerequisites
- [Docker](https://www.docker.com/)
- [Dapr CLI](https://dapr.io/)
- [Spin CLI](https://www.fermyon.com/spin)
> for examplary installation for **Dapr CLI** and **Spin CLI** on Ubuntu see below
### Running the application
1. Start Dapr
```bash
dapr init
```
2. Build the application
```bash
spin build
```
3. Start the application
```bash
dapr run --app-id spin-dapr-poc --app-port 3000 --dapr-http-port 3500 --resources-path ./components -- spin up
```
4. Invoke the application
- Using the test.http file in VS Code, or
- Using the following curl command:
```bash
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:
[](https://youtu.be/VP7bJXk6YFU)
### sample installation on Ubuntu 22.10
```shell
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
```