Host on Node
The node target runs the app as WebAssembly under Node 20 or newer. It is the target for Amplify, Firebase, Azure, Stormkit, Zeabur and any other Node host. For your own server, the native binary is faster and has more features.
Build
rustup target add wasm32-unknown-unknown # once
wisp build --target node # dist/node (--out <folder>)
In AWS Amplify's CI a plain wisp build picks node from AWS_APP_ID.
Deploy
From dist/node:
npm start
It runs node server.mjs and listens on $PORT. The output's hosts/ folder has a note for each host (amplify.md, firebase.md, azure.md, stormkit.md, zeabur.md) with its manifest or function glue.
Environment
WISP_SECRET: set it in the host's environment settings, for an app that signs cookies.- Read other values with
wisp::env("KEY")(std::env::varsees nothing). WISP_NODE_HTTP=1serves withnode:http. See Environment variables.
Limits
- The app's own HTTP/1.1 parser answers over raw sockets. At startup a request over loopback must be answered as the app answers it (twice, on one connection); if not, or with
WISP_NODE_HTTP=1, it serves withnode:http(one stderr line says which). Only that path reads at mostWISP_BODY_LIMIT(default 1 MB) of a body and answers 413 past it. - WebSockets answer 501; use
Response::events(SSE). Streaming is live. - No threads or files: use
wisp::spawnandwisp::sleep. See What works on the edge. - There is no cron trigger to write: the build says so and stops when the app uses
wisp::cron.
Files and Data
Table::savedandRestare per-instance memory unlessWISP_STOREis set (libsql://; see Saved tables).
More
Host on Azure, Edge and serverless targets, Deploying.
Is This Page Useful?