{"id":29419887,"url":"https://github.com/bytecodealliance/sample-wasi-http-js","last_synced_at":"2026-04-14T11:01:10.748Z","repository":{"id":287053011,"uuid":"963441042","full_name":"bytecodealliance/sample-wasi-http-js","owner":"bytecodealliance","description":"An example `wasi:http` server component written in JavaScript","archived":false,"fork":false,"pushed_at":"2026-04-13T11:29:40.000Z","size":147,"stargazers_count":10,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-13T12:28:30.777Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bytecodealliance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-09T17:27:39.000Z","updated_at":"2026-04-13T11:29:47.000Z","dependencies_parsed_at":"2025-04-09T18:48:50.900Z","dependency_job_id":"8c3e890f-a1bf-4978-b8fe-c88bc3517111","html_url":"https://github.com/bytecodealliance/sample-wasi-http-js","commit_stats":null,"previous_names":["andreiltd/sample-wasi-http-js"],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/bytecodealliance/sample-wasi-http-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytecodealliance%2Fsample-wasi-http-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytecodealliance%2Fsample-wasi-http-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytecodealliance%2Fsample-wasi-http-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytecodealliance%2Fsample-wasi-http-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytecodealliance","download_url":"https://codeload.github.com/bytecodealliance/sample-wasi-http-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytecodealliance%2Fsample-wasi-http-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31793225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-12T01:13:16.447Z","updated_at":"2026-04-14T11:01:10.736Z","avatar_url":"https://github.com/bytecodealliance.png","language":"JavaScript","readme":"# Sample: `wasi:http` in JavaScript\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/bytecodealliance/sample-wasi-http-js)\n\nAn example project showing how to build a spec-compliant\n[`wasi:http/proxy`][wasi-http] server for WASI 0.2 written in JavaScript.\n\n## Routes\n\nThe following HTTP routes are available from the component:\n\n```text\n/               # Hello world\n/sleep          # Sleep for {ms} milliseconds\n/echo           # Echo the HTTP body\n/echo-headers   # Echo the HTTP headers\n/upload         # Echo uploaded blob\n```\n\nTesting routes:\n\n```bash\n# Hello world\n$ curl localhost:8080\n# Sleep for {ms} milliseconds\n$ curl localhost:8080/sleep/2000\n# Echo the HTTP body\n$ curl -d \"Test echo body\" localhost:8080/echo\n# Echo the HTTP headers\n$ curl -H \"X-Test-Header: 123\" localhost:8080/echo-headers\n# Echo uploaded blob\n$ echo \"Hello World!\" \u003e test_file.txt\n$ curl -H \"Content-Type: text/plain\" --data-binary @test_file.txt http://localhost:8080/upload\n```\n\n## Quick Start\n\nThe project uses [`Wasmtime`][wasmtime] as its runtime. However, if needed, it\ncan easily be adjusted to use [`jco`][jco] instead. For `wasmtime` installation,\nsimply run:\n\n```bash\n$ curl https://wasmtime.dev/install.sh -sSf | bash\n```\n\nTo build and serve the wasm component on `localhost:8080`:\n\n```bash\n$ npm install\n$ npm run serve\n```\n\nThen send requests to the component:\n\n```bash\n$ curl localhost:8080\n```\n\n## Development\n\n```bash\n$ npm run build       # Build the wasm component\n$ npm test            # Run tests\n$ npm run fmt         # Format code\n$ npm run fmt:check   # Check formatting\n$ npm run lint        # Lint code\n$ npm run wit:fetch   # Fetch WIT dependencies\n$ npm run wit:update  # Update WIT lock file\n```\n\n## See Also\n\n- [sample-wasi-http-rust][rust-sample] An example `wasi:http` server component written in Rust.\n\n## License\n\nApache-2.0 with LLVM Exception\n\n[jco]: https://github.com/bytecodealliance/jco\n[rust-sample]: https://github.com/bytecodealliance/sample-wasi-http-rust\n[wasi-http]: https://github.com/WebAssembly/wasi-http\n[wasmtime]: https://wasmtime.dev/\n","funding_links":[],"categories":["Components"],"sub_categories":["Applications"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytecodealliance%2Fsample-wasi-http-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytecodealliance%2Fsample-wasi-http-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytecodealliance%2Fsample-wasi-http-js/lists"}