https://github.com/nordcloud/nordcloud-webassembly-lambda-demo
Nordcloud WebAssembly Lambda Demo
https://github.com/nordcloud/nordcloud-webassembly-lambda-demo
Last synced: 11 months ago
JSON representation
Nordcloud WebAssembly Lambda Demo
- Host: GitHub
- URL: https://github.com/nordcloud/nordcloud-webassembly-lambda-demo
- Owner: nordcloud
- Created: 2022-08-08T15:21:50.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T20:33:13.000Z (about 3 years ago)
- Last Synced: 2025-05-30T14:32:45.476Z (about 1 year ago)
- Language: TypeScript
- Size: 14.4 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nordcloud WebAssembly Lambda Demo
Kenneth Falck 2022
## Overview
This demo deploys Lambda functions that execute WebAssembly code using Node.js - [source](https://github.com/nordcloud/nordcloud-webassembly-lambda-demo/blob/master/lib/webassembly.function.ts).
The WebAssembly applications are built using a few different tools:
* AssemblyScript: Compile .ts into .wasm - [source](https://github.com/nordcloud/nordcloud-webassembly-lambda-demo/blob/master/wasm/demo-as.ts)
* C and WASI SDK: Compile .c into .wasm - [source](https://github.com/nordcloud/nordcloud-webassembly-lambda-demo/blob/master/wasm/demo-c.c)
* C++ and WASI SDK: Compile .cpp into .wasm [source](https://github.com/nordcloud/nordcloud-webassembly-lambda-demo/blob/master/wasm/demo-cpp.cpp)
The demo also includes a simple UI to show the output of the Lambda functions - [source](https://github.com/nordcloud/nordcloud-webassembly-lambda-demo/tree/master/ui).
## Prerequisites
To deploy this app, you need:
* Node.js 16.x or later
To build the WebAssembly applications, you need:
* clang (e.g. apt install clang)
* [wasi-sdk-16.0](https://github.com/WebAssembly/wasi-sdk) installed in $HOME
Pre-built .wasm files are also included in the project in the wasm subdirectory.
## Installation
To install dependencies, run:
npm install
## Building
To build the WebAssembly applications, run:
npm run build
To build the web UI, run:
npm run build:ui
## Deployment
To deploy the project using AWS CDK, run:
npm run deploy:dev:us
npm run deploy:dev
Note that the us-east-1 stack must be deployed first so that CloudFront can use the certificate.