Go to file
Brian fbc3874ee2
Merge pull request #1519 from fibonacci1729/bump-versions-v1.2.1
bump versions for 1.2.1
2023-05-18 16:42:54 -04:00
.cargo chore: rename fermyon-* to spin-* 2021-11-29 19:12:45 -08:00
.devcontainer Squashed and signed. 2023-04-24 10:31:39 +01:00
.github Use the version of `cargo vet` that works with the audit config 2023-04-19 14:08:38 +12:00
.vscode Remove autobindle from recommended VS Code extensions 2023-05-11 08:19:34 +12:00
crates Merge pull request #1463 from radu-matei/feat/kv-azure-cosmos 2023-05-18 08:50:01 +02:00
deploy chore(docs): bump spin version 2023-03-23 15:59:07 -04:00
docs sip: Add runtime config section to Key-Value SIP 2023-04-05 13:23:09 -04:00
examples Update README.md 2023-05-12 12:21:10 -04:00
sdk Merge pull request #1499 from fibonacci1729/sdk-1498 2023-05-18 11:23:45 -04:00
src Merge pull request #1492 from cardoso/feat/more_build_info 2023-05-18 08:07:50 +12:00
supply-chain Regenerate cargo vet exemptions 2023-03-25 20:24:48 +02:00
templates bump versions for 1.2.1 2023-05-18 13:00:13 -04:00
tests bump versions for 1.2.1 2023-05-18 13:00:13 -04:00
tools/modsurfer chore: add tools directory and include modsurfer 2023-04-03 22:38:05 -06:00
wit remove WASI files from wit/preview2 (#1476) 2023-05-11 21:10:32 -06:00
.dockerignore generate appname for template based tests 2023-02-03 18:54:28 +05:30
.gitignore ref(sdk/go): use `spin build` for building test fixtures 2023-05-11 08:44:43 -07:00
CODE_OF_CONDUCT.md ref(*): add CoC, CONTRIBUTING files to repo 2022-05-12 19:07:39 -04:00
CONTRIBUTING.md Add `cargo vet` for auditing dependencies and SIP 2023-01-06 00:59:21 +00:00
Cargo.lock bump versions for 1.2.1 2023-05-18 13:00:13 -04:00
Cargo.toml bump versions for 1.2.1 2023-05-18 13:00:13 -04:00
LICENSE license: add LLVM exception to Apache License Version 2.0 2022-03-30 12:46:07 +02:00
Makefile implement component support (#1321) 2023-03-27 12:11:30 -06:00
README.md Update README.md 2023-04-27 17:57:51 -04:00
build.rs feat(plugins): provide additional build info 2023-05-17 01:48:53 -03:00
e2e-tests-aarch64.Dockerfile implement component support (#1321) 2023-03-27 12:11:30 -06:00
e2e-tests-docker-compose.yml add e2e tests for php, swift, oci, longevity 2023-03-03 13:00:40 +05:30
e2e-tests.Dockerfile implement component support (#1321) 2023-03-27 12:11:30 -06:00

README.md

Fermyon Spin

spin logo

Spin is a framework for building, deploying, and running fast, secure, and composable cloud microservices with WebAssembly.

build status Discord

What is Spin?

Spin is an open source framework for building and running fast, secure, and composable cloud microservices with WebAssembly. It aims to be the easiest way to get started with WebAssembly microservices, and takes advantage of the latest developments in the WebAssembly component model and Wasmtime runtime.

Spin offers a simple CLI that helps you create, distribute, and execute applications, and in the next sections we will learn more about Spin applications and how to get started.

Getting started

See the Install Spin page of the Spin documentation for a detailed guide on installing and configuring Spin, but in short run the following commands:

curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
sudo mv ./spin /usr/local/bin/spin

Alternatively, you could build Spin from source.

To get started writing apps, follow the quickstart guide, and then follow the Rust, JavaScript, Python, or Go language guides, and the guide on writing Spin applications.

Usage

Below is an example of using the spin CLI to create a new Spin application. To run the example you will need to install the wasm32-wasi target for Rust.

$ rustup target add wasm32-wasi

First, run the spin new command to create a Spin application from a template.

# Create a new Spin application named 'hello-rust' based on the Rust http template, accepting all defaults
$ spin new --accept-defaults http-rust hello-rust

Running the spin new command created a hello-rust directory with all the necessary files for your application. Change to the hello-rust directory and build the application with spin build, then run it locally with spin up:

# Compile to Wasm by executing the `build` command.
$ spin build
Executing the build command for component hello-rust: cargo build --target wasm32-wasi --release
    Finished release [optimized] target(s) in 0.03s
Successfully ran the build command for the Spin components.

# Run the application locally.
$ spin up
Logging component stdio to ".spin/logs/"

Serving http://127.0.0.1:3000
Available Routes:
  hello-rust: http://127.0.0.1:3000 (wildcard)

That's it! Now that the application is running, use your browser or cURL in another shell to try it out:

# Send a request to the application.
$ curl -i 127.0.0.1:3000
HTTP/1.1 200 OK
foo: bar
content-length: 14
date: Thu, 13 Apr 2023 17:47:24 GMT

Hello, Fermyon         

You can make the app do more by editting the src/lib.rs file in the hello-rust directory using your favorite editor or IDE. To learn more about writing Spin applications see Writing Applications in the Spin documentation. To learn how to publish and distribute your application see the Publishing and Distribution guide in the Spin documentation.

For more information on the cli commands and subcommands see the CLI Reference.

Language Support for Spin Features

The table below summarizes the feature support in each of the language SDKs.

Feature Rust SDK Supported? TypeScript SDK Supported? Python SDK Supported? Tiny Go SDK Supported? C# SDK Supported?
Triggers
HTTP Supported Supported Supported Supported Supported
Redis Supported Not Supported Not Supported Supported Not Supported
APIs
Outbound HTTP Supported Supported Supported Supported Supported
Key Value Storage Supported Supported Supported Supported Not Supported
MySQL Supported Not Supported Not Supported Not Supported Not Supported
PostgreSQL Supported Not Supported Not Supported Not Supported Supported
Outbound Redis Supported Supported Supported Supported Supported
Extensibility
Authoring Custom Triggers Supported Not Supported Not Supported Not Supported Not Supported

Contributing

We are delighted that you are interested in making Spin better! Thank you! Please follow the contributing guide. And join our Discord server.

Stay in Touch

Follow us on Twitter: @spinframework

You can join the Spin community in our Discord server where you can ask questions, get help, and show off the cool things you are doing with Spin!