Static Sites, JS & Frameworks
Deploy a single JavaScript file, a static HTML/CSS/JS folder, or a built framework directory—over Remote MCP or standard SSH.
Single-file JavaScript app
Use either serve(req => ...) or standard Workers-style export default { fetch(request) }:
// app.js
serve(req => {
const url = new URL(req.url);
if (url.pathname === "/api/time") {
return Response.json({ now: new Date().toISOString() });
}
return new Response("<h1>Hello from nma.sh</h1>", {
headers: { "content-type": "text/html; charset=utf-8" }
});
});Deploy over SSH (or pass source to the deploy MCP tool):
ssh nma.sh deploy myapp --json < app.jsOmit myapp to auto-generate a name. Every deploy compiles, snapshots, probes the first request, and returns the live HTTPS URL.
Static websites & SPAs
A folder with index.html and no app.js is compiled as a pure static site—served directly from the edge with ETag, Range, gzip/Brotli compression, and pretty URLs (/about serves /about.html).
tar czf - -C ./dist . | ssh nma.sh deploy mysite --jsonOver Remote MCP, pass a files object directly to the deploy tool:
{
"app": "mysite",
"files": {
"index.html": "<!doctype html><h1>Hello</h1>",
"style.css": "body { font-family: monospace; }",
"_redirects": "/* /index.html 200"
}
}_redirects and _headers
_redirects(up to 200 rules):/old /new 301or SPA catch-all/* /index.html 200._headers(up to 100 rules, 8 KiB total): attach custom cache or security headers by path pattern.
Frameworks (Vite, Astro, SvelteKit, Hono, Next.js, Nuxt)
Install the optional local CLI (verifies SHA-256 checksums automatically) to pack multi-file apps and frameworks or run local previews:
curl -fsSL https://nma.sh/dl/install.sh | sh
nanovm dev ./app.js # local preview
nanovm pack . | ssh nma.sh deploy myapp --jsonStatic framework outputs (like Vite dist/ or Astro static builds) don't even need the CLI—just pipe the build folder with tar.
Logs, rollback & deletion
- Logs:
ssh nma.sh logs myapp --limit 100(orlogsMCP tool) returns recent console output as NDJSON. - Rollback: Apps retain their last 10 versions. Run
ssh nma.sh rollback myapp(orpromote myapp VERSION) to switch immediately. If a new deploy's first probe returns 5xx, nma.sh flags it as an error so you can fix or roll back immediately. - Delete:
ssh nma.sh delete myapp(owner key) immediately returns HTTP 404 and frees your concurrent app slot. Retained versions are purged after 24 hours.