Skip to content

eigr/spawn-node-sdk

Repository files navigation

Spawn Actor Mesh Runtime for Node/Bun

Installation

Install Spawn CLI

curl -sSL https://github.com/eigr/spawn/releases/download/v1.4.3/install.sh | sh

Getting Started

We recommend you to use Typescript for better usage overall.

This lib supports both Bun and NodeJS runtimes, Bun performs invocations ~2x faster, we recommend using Bun.

Create a new project with

spawn new node hello_world

Run the new project with your preferred package manager

# with yarn
yarn start

# or with pnpm
pnpm start

# or if you want to use bun instead of NodeJS use:
yarn start-bun

Run the Spawn Proxy using the CLI for dev purposes

spawn dev run -p ./protos -s spawn-system -W

Invoking the actor

Thats it! You can test invoking the hello world actor with our pre configured HTTP activator.

curl -vvv -H 'Accept: application/json' http://localhost:9980/v1/hello_world?message=World

Documentation

Examples

You can check test folder to see some examples

Environment variables: (you don't need to worry if you are using spawn proxy)

  • PROXY_HTTP_PORT This is the port of spawn proxy service
  • PROXY_HTTP_HOST This is the host of spawn proxy service
  • USER_FUNCTION_PORT This is the port that your service will expose to communicate with Spawn

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published