Code Monkey home page Code Monkey logo

wasm-workers-server's Introduction

Wasm Workers Server

Develop and run serverless applications on WebAssembly ๐Ÿš€

GitHub Workflow Status GitHub release (latest by date) GitHub GitHub contributors

workers.wasmlabs.dev


Wasm Workers Server (wws) is an open source tool to develop and run serverless applications server on top of WebAssembly. The applications are composed by multiple modules called workers. Each of these tiny modules is in charge of replying to a specific HTTP endpoint in your application.

When you start wws, it loads the existing workers in the given path or remote repository. You can write a worker in different languages like Rust, JavaScript, Go, Ruby and Python. The filenames and folders determine the final routes that will be served. For example, the index.js will reply to the / endpoint.

Getting started (5 minutes)

  1. Download and install Wasm Worker Sever:

    curl -fsSL https://workers.wasmlabs.dev/install | bash
  2. Create an index.js file with the following content:

    addEventListener("fetch", event => {
      return event.respondWith(
        new Response("Hello from Wasm Workers Server!")
      );
    });
  3. Run wws:

    $ wws .
    โš™๏ธ  Preparing the project from: .
    โš™๏ธ  Loading routes from: .
    โณ Loading workers from 1 routes...
    โœ… Workers loaded in 141.613666ms.
        - http://127.0.0.1:8080/
          => ./index.js
    ๐Ÿš€ Start serving requests at http://127.0.0.1:8080
  4. Access to http://127.0.0.1:8080.

Congrats! You just created your first worker ๐ŸŽ‰. From this point, you can explore the different examples and guides:

Run in a container

If you don't want to install anything locally you can just run wws from the ghcr.io/vmware-labs/wws:latest container image. You only need to mount your project in the /app folder:

docker run --rm -v $(pwd):/app -p 8080:8080 ghcr.io/vmware-labs/wws:latest

Documentation

All our documentation is available at https://workers.wasmlabs.dev.

Features

You can find all the available features in the documentation. It includes dynamic routes, an in-memory K/V store, etc.

Language Support

Wasm Workers Server focuses on simplicity. We want you to run workers (written in different languages) safely in WebAssembly. For interpreted languages, we add different interpreters:

Language Support Requires an external runtime Issue
Rust โœ… No -
JavaScript โœ… No -
Go โœ… No #95
Ruby โœ… Yes #63
Python โœ… Yes #63
Zig โœ… No #144
PHP ๐Ÿšง No #100

To get more information about multi-language support in Wasm Workers Server, check our documentation.

Development

Prerequisites

To work with this project you will need to install:

Run the project

After installing the different prerequisites, you can run the development environment with:

$ cargo run -- --help

Wasm Workers Server is split into different Rust crates. The root project produces the wws, while every crate provides specific features.

Contributing

See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

License

Wasm Workers Server is distributed under the terms of the Apache License (Version 2.0).

See LICENSE for details.

wasm-workers-server's People

Contributors

angelmmiguel avatar ereslibre avatar assambar avatar vmwghbot avatar taisukef avatar gzurl avatar dierbei avatar voigt avatar sea-grass avatar flavio avatar carrycooldude avatar kbwo avatar mnafees avatar narayanbhat166 avatar ssssota avatar dependabot[bot] avatar mtt-artis 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.