Creating Rust Functions in Node.js with SSVM and Docker

prateekjaindev

Prateek Jain

Posted on August 28, 2020

Creating Rust Functions in Node.js with SSVM and Docker

I recently came across SSVM with which we can easily create an app with Rust functions. I followed these steps for creating the application:

1. Creating the development environment with Docker

Get the code

$ git clone https://github.com/second-state/ssvm-nodejs-starter
$ cd ssvm-nodejs-starter

Run Docker container

$ docker pull secondstate/ssvm-nodejs-starter:v1
$ docker run -p 8080:8080 --rm -it -v $(pwd):/app secondstate/ssvm-nodejs-starter:v1
(docker) $ cd /app

2. Create an application

Copy the example application

https://github.com/second-state/wasm-learning/tree/master/nodejs/quadratic

Replace files in the sample application and build

$ ssvmup build
$ npm install express # The application requires the Express framework in Node.js
$ node node/server.js

3. Run application in the browser and check

From the web browser, go to http://localhost:8080/ to access this application.

Alt Text

💖 💪 🙅 🚩
prateekjaindev
Prateek Jain

Posted on August 28, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024