christiankrag 02d32536a0 Fix wws runtime compatibility - use module.exports pattern
- Update api/index.js to use handler export format
- Update chat/index.js to use handler export format
- Update webhook/index.js to use handler export format
- Remove addEventListener('fetch') pattern incompatible with wws
- Remove URL API usage (not available in wws JS runtime)
- Remove spread operator for better compatibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-15 05:56:18 +01:00

Mylder WebAssembly Serverless Functions

Self-hosted serverless functions using wasm-workers-server. Cloudflare Workers compatible API with zero vendor lock-in.

Endpoints

Path Description
/api Health check and service info
/chat Chat proxy to n8n AI workflow
/webhook Webhook receiver for external integrations

Usage

Chat API

curl -X POST https://wws.mylder.io/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Help me brainstorm ideas", "provider": "zai"}'

Webhook

curl -X POST "https://wws.mylder.io/webhook?source=gitea" \
  -H "Content-Type: application/json" \
  -d '{"event": "push", "repo": "mylder-frontend"}'

Development

# Install wws
curl -fsSL https://workers.wasmlabs.dev/install | bash

# Run locally
wws .

# Test
curl http://localhost:8080/api

Deployment

Deployed via Dokploy with auto-deploy from Gitea on push to main branch.

Description
Mylder WebAssembly Serverless Functions
Readme 47 KiB
Languages
JavaScript 97.4%
Dockerfile 2.6%