Coder Social home page Coder Social logo

jpflueger / spin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fermyon/spin

0.0 0.0 0.0 26.61 MB

Spin is an open source framework for building and running fast, secure, and composable cloud microservices with WebAssembly

Home Page: https://developer.fermyon.com/spin

License: Apache License 2.0

Shell 0.07% C 0.06% Go 0.13% Rust 98.69% Swift 0.02% Makefile 0.27% Dockerfile 0.24% Zig 0.01% HCL 0.21% PHP 0.01% Nix 0.07% Python 0.22%

spin's Introduction

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 -t 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
Configuration Variables Supported Supported Supported Supported Supported
Key Value Storage Supported Supported Supported Supported Not Supported
SQLite Storage Supported Supported Supported Supported Not Supported
MySQL Supported Supported Not Supported Supported Not Supported
PostgreSQL Supported Supported Not Supported Supported Supported
Outbound Redis Supported Supported Supported Supported Supported
Serverless AI Supported Supported Supported Supported Not 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!

spin's People

Contributors

itowlson avatar rylev avatar lann avatar radu-matei avatar vdice avatar rajatjindal avatar fibonacci1729 avatar michellen avatar dicej avatar adamreese avatar kate-goldenring avatar bacongobbler avatar etehtsea avatar karthik2804 avatar tpmccallum avatar suneetnangia avatar frankyang0529 avatar mossaka avatar calebschoepp avatar flynnduism avatar endocrimes avatar dependabot[bot] avatar alexcrichton avatar technosophos avatar fermybot avatar melissaklein24 avatar tschneidereit avatar mikkelhegn avatar mooori avatar miketang84 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.