This example shows how to run Node.js on Wasmer Edge as an HTTP server.
https://<your-subdomain>.wasmer.app/ (deploy to get a live URL)
server.jsuses Node's built-inhttpmodule and listens onprocess.env.PORT.package.jsondefinesnpm start, which runs the server entrypoint.- Wasmer Edge runs the Node.js process and forwards HTTP traffic to the configured port.
npm install
npm startOpen http://127.0.0.1:8080/ to hit the server locally. Set PORT=... if you want to use a different port.
- Install dependencies and confirm the app starts locally.
- Deploy from this example directory with
wasmer deploy. - Visit
https://<your-subdomain>.wasmer.app/once the deployment is live.