Skip to content

Commit f126eb3

Browse files
MendyBergervados-cosmonic
authored andcommitted
feat(examples): add stdout example
Signed-off-by: Mendy Berger <12537668+MendyBerger@users.noreply.github.com>
1 parent 46a7abc commit f126eb3

11 files changed

Lines changed: 1954 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
build
13+
generated/**
14+
*.tgz
15+
16+
wit/deps
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
new:
2+
command: npm install
3+
4+
build:
5+
command: npm run build
6+
component_path: dist/http_stdout.wasm
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# HTTP stdout/stderr
2+
3+
A small WebAssembly component that demonstrates writing to stdout and stderr
4+
from an HTTP handler using [`wasi:cli`](https://github.com/WebAssembly/wasi-cli)
5+
streams.
6+
7+
The component responds to `GET /?name=<name>`:
8+
9+
## Usage
10+
11+
```bash
12+
npm install
13+
npm run build
14+
npm run serve
15+
```
16+
17+
Then send a request:
18+
19+
```bash
20+
curl 'localhost:8000/?name=john'
21+
```
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"watch": ["src"],
3+
"ext": "ts",
4+
"delay": 1000,
5+
"exec": "wash dev"
6+
}

0 commit comments

Comments
 (0)