GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - embly/embly: Attempt at building an opinionated webassembly runtime for web services

This repository was archived by the owner on Jan 24, 2023. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

55 Commits
55 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
app
app
 
 
build
build
 
 
cmd/embly
cmd/embly
 
 
compilers
compilers
 
 
embly-rs
embly-rs
 
 
embly-wrapper-rs
embly-wrapper-rs
 
 
examples
examples
 
 
nix
nix
 
 
notes
notes
 
 
pkg
pkg
 
 
tests
tests
 
 
tools
tools
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
Cargo.toml
Cargo.toml
 
 
Makefile
Makefile
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
readme.md
readme.md
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

embly

A serverless web application framework for collaboration and scale.

For more background and details about what embly is read here or here

Hello World

Create a new folder and add the following files and directory structure:

├── embly.hcl
└── hello
    ├── Cargo.toml
    └── src
        └── main.rs

Now add the following file contents:

embly.hcl:

function "hello" {
  runtime = "rust"
  path    = "./hello"
}

gateway {
  type = "http"
  port = 8765
  route "/" {
    function = "${function.hello}"
  }
}

hello/Cargo.toml:

[package]
name = "hello"
version = "0.0.1"
edition = "2018"

[dependencies]
embly = "0.0.5"

hello/src/main.rs:

extern crate embly;
use embly::{
  http::{run_catch_error, Body, Request, ResponseWriter},
  prelude::*,
  Error,
};

async fn execute(_req: Request<Body>, mut w: ResponseWriter) -> Result<(), Error> {
  w.write_all(b"Hello World")?; // writing our hello response bytes
  Ok(()) // if an error is returned the server will respond with an HTTP error
}

// this function is run first
fn main() {
  run_catch_error(execute); // this is the embly::http::run function that is specific to http responses
}

You can now run your project for local development with embly dev, although the fastest way to get started is with docker:

docker run -v /var/run/docker.sock:/var/run/docker.sock  -v $(pwd):/app -p 8765:8765 -it embly/embly embly dev

More on how to run embly in the installation section.

The embly Command

$ embly
Usage: embly [--version] [--help] <command> [<args>]

Available commands are:
    build     Build an embly project
    bundle    Create a bundled project file
    db        Run various database maintenace tasks. 
    dev       Develop a local embly project
    run       Run a local embly project

Installation

embly uses docker to download and run build images. It's recommended that you run embly from within a docker container and give it access to the docker socket. If you are in the root of an embly project you can start the dev server like so:

docker run -v /var/run/docker.sock:/var/run/docker.sock  -v $(pwd):/app -p 8765:8765 -it embly/embly embly dev

If you would like to run embly locally you'll need to have cargo and go installed. The following sequence of commands should work:

go get github.com/embly/embly/cmd/embly
cargo install embly-wrapper
cargo install lucetc

Links

  • homepage
  • what is embly?
  • rust library documentation
  • example app and source
  • docker images

embly used to be wasabi, which was more focused on providing full operating system functionality within a webassembly runtime. That code is available here.

About

Attempt at building an opinionated webassembly runtime for web services

Topics

abirustserverlesswasiwebassembly

Resources

Readme
Activity
Custom properties

Stars

99 stars

Watchers

1 watching

Forks

10 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.