WASM Server

Build your normal app as an http server, but load it as a WebAssembly module or Service Worker

Technology

The wasmserver module for Project Forge enables building your HTTP server application as a WebAssembly module that runs in web browsers using Service Workers. This allows your Go application to run entirely client-side without requiring a traditional server infrastructure.

Overview

This module transforms your Project Forge application into a WebAssembly binary that can be executed in web browsers, enabling:

Key Features

WebAssembly Compilation

Service Worker Integration

Static File Generation

Build Process

Building WASM Server

1
2
3
4
# Build the WASM server
./bin/build/wasmserver.sh

# Files are generated in ./tools/wasmserver/

Generated Files

The build process creates:

Deployment

Requirements

Hosting Options

1
2
3
4
5
6
7
8
# Local development
cd tools/wasmserver
python3 -m http.server 8080

# Or using Node.js
npx serve .

# Or any static file server

Production Deployment

Deploy the tools/wasmserver directory contents to any static hosting service: - Netlify, Vercel, GitHub Pages - AWS S3 + CloudFront - Traditional web hosting - CDN services

Limitations

Browser Restrictions

Performance Considerations

Functionality Gaps

Source Code

See Also