diff --git a/README.md b/README.md index 5819374e..3cd7bf2e 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,9 @@ wash new https://github.com/wasmCloud/typescript.git --name my-project --subfold | [http-hello-world-hono](./templates/http-hello-world-hono/) | Minimal HTTP server component using Hono | | [http-hello-world-fetch](./templates/http-hello-world-fetch/) | Minimal HTTP server component using the `fetch()` API | | [http-client](./templates/http-client/) | Component that makes outgoing HTTP requests | -| [http-service-hono](./templates/http-service-hono/) | HTTP service component powered by Hono | -| [http-blobstore-service-hono](./templates/http-blobstore-service-hono/) | HTTP service component powered by Hono, backed by `wasi:blobstore` | -| [http-kv-service-hono](./templates/http-kv-service-hono/) | HTTP service component powered by Hono, backed by `wasi:keyvalue` | +| [http-handler-hono](./templates/http-handler-hono/) | HTTP handler component powered by Hono | +| [http-blobstore-handler-hono](./templates/http-blobstore-handler-hono/) | HTTP handler component powered by Hono, backed by `wasi:blobstore` | +| [http-kv-handler-hono](./templates/http-kv-handler-hono/) | HTTP handler component powered by Hono, backed by `wasi:keyvalue` | | [service-tcp-echo](./templates/service-tcp-echo/) | Service + component template demonstrating `wasi:sockets` TCP | See the [templates README](./templates/README.md) for more details. diff --git a/templates/README.md b/templates/README.md index 712f19ed..9e341103 100644 --- a/templates/README.md +++ b/templates/README.md @@ -9,9 +9,9 @@ Project templates for building wasmCloud components with TypeScript. | [http-hello-world-hono](./http-hello-world-hono/) | Minimal HTTP server component using Hono | | [http-hello-world-fetch](./http-hello-world-fetch/) | Minimal HTTP server component using the `fetch()` API | | [http-client](./http-client/) | Component that makes outgoing HTTP requests | -| [http-service-hono](./http-service-hono/) | HTTP service component powered by Hono | -| [http-blobstore-service-hono](./http-blobstore-service-hono/) | HTTP service component powered by Hono, backed by `wasi:blobstore`| -| [http-kv-service-hono](./http-kv-service-hono/) | HTTP service component powered by Hono, backed by `wasi:keyvalue` | +| [http-handler-hono](./http-handler-hono/) | HTTP handler component powered by Hono | +| [http-blobstore-handler-hono](./http-blobstore-handler-hono/) | HTTP handler component powered by Hono, backed by `wasi:blobstore`| +| [http-kv-handler-hono](./http-kv-handler-hono/) | HTTP handler component powered by Hono, backed by `wasi:keyvalue` | | [service-tcp-echo](./service-tcp-echo/) | Service + component template demonstrating `wasi:sockets` TCP | ## Template Structure @@ -60,8 +60,8 @@ For example: package wasmcloud:templates@0.1.0; // language: typescript -// use-case: http-service-hono -world typescript-http-service-hono { +// use-case: http-handler-hono +world typescript-http-handler-hono { export wasi:http/incoming-handler@0.2.3; } ``` diff --git a/templates/http-blobstore-service-hono/.gitignore b/templates/http-blobstore-handler-hono/.gitignore similarity index 100% rename from templates/http-blobstore-service-hono/.gitignore rename to templates/http-blobstore-handler-hono/.gitignore diff --git a/templates/http-blobstore-service-hono/.wash/config.yaml b/templates/http-blobstore-handler-hono/.wash/config.yaml similarity index 65% rename from templates/http-blobstore-service-hono/.wash/config.yaml rename to templates/http-blobstore-handler-hono/.wash/config.yaml index ec8cea27..e8db8266 100644 --- a/templates/http-blobstore-service-hono/.wash/config.yaml +++ b/templates/http-blobstore-handler-hono/.wash/config.yaml @@ -3,7 +3,7 @@ new: build: command: npm run build - component_path: dist/http_blobstore_service_hono.wasm + component_path: dist/http_blobstore_handler_hono.wasm dev: wasi_blobstore_path: tmp/blobstore diff --git a/templates/http-blobstore-service-hono/README.md b/templates/http-blobstore-handler-hono/README.md similarity index 90% rename from templates/http-blobstore-service-hono/README.md rename to templates/http-blobstore-handler-hono/README.md index ab487389..68488994 100644 --- a/templates/http-blobstore-service-hono/README.md +++ b/templates/http-blobstore-handler-hono/README.md @@ -1,6 +1,6 @@ -# HTTP + Blobstore Service with Hono in TypeScript +# HTTP + Blobstore Handler with Hono in TypeScript -This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates a comprehensive HTTP service using the [Hono][hono] web framework, with persistent storage backed by [`wasi:blobstore`][wasi-blobstore]. +This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates a comprehensive HTTP handler using the [Hono][hono] web framework, with persistent storage backed by [`wasi:blobstore`][wasi-blobstore]. [wasi-blobstore]: https://github.com/WebAssembly/wasi-blobstore @@ -30,11 +30,11 @@ This project also uses [`rolldown`][rolldown] to transpile Typescript and bundle Use `wash new` to scaffold a new wasmCloud component project: ```shell -wash new https://github.com/wasmCloud/typescript.git --name http-blobstore-service-hono --subfolder templates/http-blobstore-service-hono --git-ref v2 +wash new https://github.com/wasmCloud/typescript.git --name http-blobstore-handler-hono --subfolder templates/http-blobstore-handler-hono --git-ref v2 ``` ```shell -cd http-blobstore-service-hono +cd http-blobstore-handler-hono ``` To build this project and run in a hot-reloading development loop, run `npm run dev` from this directory: @@ -63,7 +63,7 @@ npm run dev ### Middleware -The service demonstrates several Hono middleware patterns: +The handler demonstrates several Hono middleware patterns: - **Request logging** - All requests are logged with timing information - **Response timing** - `X-Response-Time` header added to all responses @@ -110,7 +110,7 @@ curl -X POST http://localhost:8000/api/echo \ ### Error Handling -The service includes comprehensive error handling: +The handler includes comprehensive error handling: - **HTTPException** for structured error responses - **Custom 404 handler** with helpful error messages @@ -127,7 +127,7 @@ npm run build This component uses the following [WIT interfaces](https://component-model.bytecodealliance.org/design/wit.html): ```wit -world typescript-http-blobstore-service-hono { +world typescript-http-blobstore-handler-hono { import wasi:blobstore/blobstore@0.2.0-draft; export wasi:http/incoming-handler@0.2.6; diff --git a/templates/http-blobstore-service-hono/nodemon.json b/templates/http-blobstore-handler-hono/nodemon.json similarity index 100% rename from templates/http-blobstore-service-hono/nodemon.json rename to templates/http-blobstore-handler-hono/nodemon.json diff --git a/templates/http-blobstore-service-hono/package-lock.json b/templates/http-blobstore-handler-hono/package-lock.json similarity index 99% rename from templates/http-blobstore-service-hono/package-lock.json rename to templates/http-blobstore-handler-hono/package-lock.json index f9e4cc68..8a2e5406 100644 --- a/templates/http-blobstore-service-hono/package-lock.json +++ b/templates/http-blobstore-handler-hono/package-lock.json @@ -1,11 +1,11 @@ { - "name": "http-blobstore-service-hono", + "name": "http-blobstore-handler-hono", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "http-blobstore-service-hono", + "name": "http-blobstore-handler-hono", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { diff --git a/templates/http-blobstore-service-hono/package.json b/templates/http-blobstore-handler-hono/package.json similarity index 86% rename from templates/http-blobstore-service-hono/package.json rename to templates/http-blobstore-handler-hono/package.json index 7251bdb9..309efb64 100644 --- a/templates/http-blobstore-service-hono/package.json +++ b/templates/http-blobstore-handler-hono/package.json @@ -1,5 +1,5 @@ { - "name": "http-blobstore-service-hono", + "name": "http-blobstore-handler-hono", "version": "0.1.0", "description": "A WebAssembly component HTTP service powered by Hono using the wasi:http and wasi:blobstore WIT interfaces", "private": true, @@ -10,9 +10,9 @@ "generate:types": "rimraf generated/types && jco guest-types wit/ -o generated/types", "setup:wit": "npm run fetch:wit && npm run generate:types", "build:ts": "rolldown -c rolldown.config.mjs", - "build:component": "jco componentize -w wit -o dist/http_blobstore_service_hono.wasm dist/component.js", + "build:component": "jco componentize -w wit -o dist/http_blobstore_handler_hono.wasm dist/component.js", "build": "npm run setup:wit && npm run build:ts && npm run build:component", - "serve": "jco serve dist/http_blobstore_service_hono.wasm", + "serve": "jco serve dist/http_blobstore_handler_hono.wasm", "dev": "nodemon" }, "keywords": [], diff --git a/templates/http-blobstore-service-hono/rolldown.config.mjs b/templates/http-blobstore-handler-hono/rolldown.config.mjs similarity index 100% rename from templates/http-blobstore-service-hono/rolldown.config.mjs rename to templates/http-blobstore-handler-hono/rolldown.config.mjs diff --git a/templates/http-blobstore-service-hono/src/component.ts b/templates/http-blobstore-handler-hono/src/component.ts similarity index 97% rename from templates/http-blobstore-service-hono/src/component.ts rename to templates/http-blobstore-handler-hono/src/component.ts index ba50b1fe..5bd68381 100644 --- a/templates/http-blobstore-service-hono/src/component.ts +++ b/templates/http-blobstore-handler-hono/src/component.ts @@ -49,9 +49,9 @@ app.use('*', async (c, next) => { // API information app.get('/', (c) => { return c.json({ - name: 'Hono HTTP Blobstore Service', + name: 'Hono HTTP Blobstore Handler', version: '1.0.0', - description: 'A comprehensive HTTP service built with Hono on wasmCloud, backed by wasi:blobstore', + description: 'A comprehensive HTTP handler built with Hono on wasmCloud, backed by wasi:blobstore', endpoints: { '/': 'API information (this page)', '/health': 'Health check endpoint', diff --git a/templates/http-blobstore-service-hono/src/routes/echo.ts b/templates/http-blobstore-handler-hono/src/routes/echo.ts similarity index 100% rename from templates/http-blobstore-service-hono/src/routes/echo.ts rename to templates/http-blobstore-handler-hono/src/routes/echo.ts diff --git a/templates/http-blobstore-service-hono/src/routes/items.ts b/templates/http-blobstore-handler-hono/src/routes/items.ts similarity index 100% rename from templates/http-blobstore-service-hono/src/routes/items.ts rename to templates/http-blobstore-handler-hono/src/routes/items.ts diff --git a/templates/http-blobstore-service-hono/tsconfig.json b/templates/http-blobstore-handler-hono/tsconfig.json similarity index 100% rename from templates/http-blobstore-service-hono/tsconfig.json rename to templates/http-blobstore-handler-hono/tsconfig.json diff --git a/templates/http-blobstore-service-hono/wit/world.wit b/templates/http-blobstore-handler-hono/wit/world.wit similarity index 73% rename from templates/http-blobstore-service-hono/wit/world.wit rename to templates/http-blobstore-handler-hono/wit/world.wit index 3e636e2c..a4b03fa3 100644 --- a/templates/http-blobstore-service-hono/wit/world.wit +++ b/templates/http-blobstore-handler-hono/wit/world.wit @@ -1,6 +1,6 @@ package wasmcloud:templates@0.1.0; -world typescript-http-blobstore-service-hono { +world typescript-http-blobstore-handler-hono { import wasi:blobstore/blobstore@0.2.0-draft; export wasi:http/incoming-handler@0.2.6; diff --git a/templates/http-blobstore-service-hono/wkg.lock b/templates/http-blobstore-handler-hono/wkg.lock similarity index 100% rename from templates/http-blobstore-service-hono/wkg.lock rename to templates/http-blobstore-handler-hono/wkg.lock diff --git a/templates/http-filesystem-service-hono/.gitignore b/templates/http-filesystem-handler-hono/.gitignore similarity index 100% rename from templates/http-filesystem-service-hono/.gitignore rename to templates/http-filesystem-handler-hono/.gitignore diff --git a/templates/http-filesystem-service-hono/.wash/config.yaml b/templates/http-filesystem-handler-hono/.wash/config.yaml similarity index 68% rename from templates/http-filesystem-service-hono/.wash/config.yaml rename to templates/http-filesystem-handler-hono/.wash/config.yaml index 60a1260b..8a503d62 100644 --- a/templates/http-filesystem-service-hono/.wash/config.yaml +++ b/templates/http-filesystem-handler-hono/.wash/config.yaml @@ -3,7 +3,7 @@ new: build: command: npm run build - component_path: dist/http_filesystem_service_hono.wasm + component_path: dist/http_filesystem_handler_hono.wasm dev: volumes: diff --git a/templates/http-filesystem-service-hono/README.md b/templates/http-filesystem-handler-hono/README.md similarity index 93% rename from templates/http-filesystem-service-hono/README.md rename to templates/http-filesystem-handler-hono/README.md index cf1575ec..e0382eff 100644 --- a/templates/http-filesystem-service-hono/README.md +++ b/templates/http-filesystem-handler-hono/README.md @@ -1,4 +1,4 @@ -# HTTP Filesystem Service with Hono in TypeScript +# HTTP Filesystem Handler with Hono in TypeScript A WebAssembly component built with [TypeScript][ts] that serves files from a mounted directory using [Hono][hono], [jco-std][jco-std], and [`wasi:filesystem`][wasi-filesystem]. @@ -30,11 +30,11 @@ This project also uses [`rolldown`][rolldown] to transpile Typescript and bundle Use `wash new` to scaffold a new wasmCloud component project: ```shell -wash new https://github.com/wasmCloud/typescript.git --name http-filesystem-service-hono --subfolder templates/http-filesystem-service-hono +wash new https://github.com/wasmCloud/typescript.git --name http-filesystem-handler-hono --subfolder templates/http-filesystem-handler-hono ``` ```shell -cd http-filesystem-service-hono +cd http-filesystem-handler-hono ``` Create a `data/` directory with some files to serve: @@ -114,7 +114,7 @@ npm run build This component uses the following [WIT interfaces](https://component-model.bytecodealliance.org/design/wit.html): ```wit -world typescript-http-filesystem-service-hono { +world typescript-http-filesystem-handler-hono { import wasi:filesystem/types@0.2.2; import wasi:filesystem/preopens@0.2.2; diff --git a/templates/http-filesystem-service-hono/nodemon.json b/templates/http-filesystem-handler-hono/nodemon.json similarity index 100% rename from templates/http-filesystem-service-hono/nodemon.json rename to templates/http-filesystem-handler-hono/nodemon.json diff --git a/templates/http-filesystem-service-hono/package-lock.json b/templates/http-filesystem-handler-hono/package-lock.json similarity index 99% rename from templates/http-filesystem-service-hono/package-lock.json rename to templates/http-filesystem-handler-hono/package-lock.json index 65457693..7d42d397 100644 --- a/templates/http-filesystem-service-hono/package-lock.json +++ b/templates/http-filesystem-handler-hono/package-lock.json @@ -1,11 +1,11 @@ { - "name": "http-filesystem-service-hono", + "name": "http-filesystem-handler-hono", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "http-filesystem-service-hono", + "name": "http-filesystem-handler-hono", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { diff --git a/templates/http-filesystem-service-hono/package.json b/templates/http-filesystem-handler-hono/package.json similarity index 86% rename from templates/http-filesystem-service-hono/package.json rename to templates/http-filesystem-handler-hono/package.json index bf8bac93..250dab67 100644 --- a/templates/http-filesystem-service-hono/package.json +++ b/templates/http-filesystem-handler-hono/package.json @@ -1,5 +1,5 @@ { - "name": "http-filesystem-service-hono", + "name": "http-filesystem-handler-hono", "version": "0.1.0", "description": "A WebAssembly component HTTP service using Hono with wasi:filesystem for reading and writing files", "private": true, @@ -10,9 +10,9 @@ "generate:types": "rimraf generated/types && jco guest-types wit/ -o generated/types", "setup:wit": "npm run fetch:wit && npm run generate:types", "build:ts": "rolldown -c rolldown.config.mjs", - "build:component": "jco componentize -w wit -o dist/http_filesystem_service_hono.wasm dist/component.js", + "build:component": "jco componentize -w wit -o dist/http_filesystem_handler_hono.wasm dist/component.js", "build": "npm run setup:wit && npm run build:ts && npm run build:component", - "serve": "jco serve dist/http_filesystem_service_hono.wasm", + "serve": "jco serve dist/http_filesystem_handler_hono.wasm", "dev": "nodemon" }, "keywords": [], diff --git a/templates/http-filesystem-service-hono/rolldown.config.mjs b/templates/http-filesystem-handler-hono/rolldown.config.mjs similarity index 100% rename from templates/http-filesystem-service-hono/rolldown.config.mjs rename to templates/http-filesystem-handler-hono/rolldown.config.mjs diff --git a/templates/http-filesystem-service-hono/src/component.ts b/templates/http-filesystem-handler-hono/src/component.ts similarity index 100% rename from templates/http-filesystem-service-hono/src/component.ts rename to templates/http-filesystem-handler-hono/src/component.ts diff --git a/templates/http-filesystem-service-hono/tsconfig.json b/templates/http-filesystem-handler-hono/tsconfig.json similarity index 100% rename from templates/http-filesystem-service-hono/tsconfig.json rename to templates/http-filesystem-handler-hono/tsconfig.json diff --git a/templates/http-filesystem-service-hono/wit/world.wit b/templates/http-filesystem-handler-hono/wit/world.wit similarity index 77% rename from templates/http-filesystem-service-hono/wit/world.wit rename to templates/http-filesystem-handler-hono/wit/world.wit index 20cc638f..8ecc5485 100644 --- a/templates/http-filesystem-service-hono/wit/world.wit +++ b/templates/http-filesystem-handler-hono/wit/world.wit @@ -1,6 +1,6 @@ package wasmcloud:templates@0.1.0; -world typescript-http-filesystem-service-hono { +world typescript-http-filesystem-handler-hono { import wasi:filesystem/types@0.2.2; import wasi:filesystem/preopens@0.2.2; diff --git a/templates/http-filesystem-service-hono/wkg.lock b/templates/http-filesystem-handler-hono/wkg.lock similarity index 100% rename from templates/http-filesystem-service-hono/wkg.lock rename to templates/http-filesystem-handler-hono/wkg.lock diff --git a/templates/http-kv-service-hono/.gitignore b/templates/http-handler-hono/.gitignore similarity index 100% rename from templates/http-kv-service-hono/.gitignore rename to templates/http-handler-hono/.gitignore diff --git a/templates/http-service-hono/.wash/config.yaml b/templates/http-handler-hono/.wash/config.yaml similarity index 57% rename from templates/http-service-hono/.wash/config.yaml rename to templates/http-handler-hono/.wash/config.yaml index 545d25af..9d10c080 100644 --- a/templates/http-service-hono/.wash/config.yaml +++ b/templates/http-handler-hono/.wash/config.yaml @@ -3,4 +3,4 @@ new: build: command: npm run build - component_path: dist/http_service_hono.wasm + component_path: dist/http_handler_hono.wasm diff --git a/templates/http-service-hono/README.md b/templates/http-handler-hono/README.md similarity index 91% rename from templates/http-service-hono/README.md rename to templates/http-handler-hono/README.md index e3158e15..9d04992d 100644 --- a/templates/http-service-hono/README.md +++ b/templates/http-handler-hono/README.md @@ -1,6 +1,6 @@ -# HTTP Service with Hono in TypeScript +# HTTP Handler with Hono in TypeScript -This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates a comprehensive HTTP service using the [Hono][hono] web framework, making requests against a simulated database. +This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates a comprehensive HTTP handler using the [Hono][hono] web framework, making requests against a simulated database. To bridge Hono's API and WebAssembly primitives, this component makes use of the [`@bytecodealliance/jco-std`][jco-std] adapter (which translates Hono API to [`wasi:http/incoming-handler`][wasi-http] primitives). @@ -28,11 +28,11 @@ This project also uses [`rolldown`][rolldown] to transpile Typescript and bundle Use `wash new` to scaffold a new wasmCloud component project: ```shell -wash new https://github.com/wasmCloud/typescript.git --name http-service-hono --subfolder templates/http-service-hono +wash new https://github.com/wasmCloud/typescript.git --name http-handler-hono --subfolder templates/http-handler-hono ``` ```shell -cd http-service-hono +cd http-handler-hono ``` To build this project and run in a hot-reloading development loop, run `npm run dev` from this directory: @@ -61,7 +61,7 @@ npm run dev ### Middleware -The service demonstrates several Hono middleware patterns: +The handler demonstrates several Hono middleware patterns: - **CORS** - Cross-origin resource sharing enabled for all origins - **Request logging** - All requests are logged with timing information @@ -109,7 +109,7 @@ curl -X POST http://localhost:8000/api/echo \ ### Error Handling -The service includes comprehensive error handling: +The handler includes comprehensive error handling: - **HTTPException** for structured error responses - **Custom 404 handler** with helpful error messages @@ -126,7 +126,7 @@ npm run build This component exports the following [WIT interfaces](https://component-model.bytecodealliance.org/design/wit.html): ```wit -world typescript-http-service-hono { +world typescript-http-handler-hono { export wasi:http/incoming-handler@0.2.3; } ``` diff --git a/templates/http-kv-service-hono/nodemon.json b/templates/http-handler-hono/nodemon.json similarity index 100% rename from templates/http-kv-service-hono/nodemon.json rename to templates/http-handler-hono/nodemon.json diff --git a/templates/http-kv-service-hono/package-lock.json b/templates/http-handler-hono/package-lock.json similarity index 99% rename from templates/http-kv-service-hono/package-lock.json rename to templates/http-handler-hono/package-lock.json index f90dccf9..aa992cb2 100644 --- a/templates/http-kv-service-hono/package-lock.json +++ b/templates/http-handler-hono/package-lock.json @@ -1,11 +1,11 @@ { - "name": "http-service-hono", + "name": "http-handler-hono", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "http-service-hono", + "name": "http-handler-hono", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { diff --git a/templates/http-service-hono/package.json b/templates/http-handler-hono/package.json similarity index 83% rename from templates/http-service-hono/package.json rename to templates/http-handler-hono/package.json index 4feb70c6..5b7729f5 100644 --- a/templates/http-service-hono/package.json +++ b/templates/http-handler-hono/package.json @@ -1,5 +1,5 @@ { - "name": "http-service-hono", + "name": "http-handler-hono", "version": "0.1.0", "description": "A WebAssembly component HTTP service powered by Hono using the wasi:http WIT interface", "private": true, @@ -10,9 +10,9 @@ "generate:types": "rimraf generated/types && jco guest-types wit/ -o generated/types", "setup:wit": "npm run fetch:wit && npm run generate:types", "build:ts": "rolldown -c rolldown.config.mjs", - "build:component": "jco componentize -w wit -o dist/http_service_hono.wasm dist/component.js", + "build:component": "jco componentize -w wit -o dist/http_handler_hono.wasm dist/component.js", "build": "npm run setup:wit && npm run build:ts && npm run build:component", - "serve": "jco serve dist/http_service_hono.wasm", + "serve": "jco serve dist/http_handler_hono.wasm", "dev": "nodemon" }, "keywords": [], diff --git a/templates/http-kv-service-hono/rolldown.config.mjs b/templates/http-handler-hono/rolldown.config.mjs similarity index 100% rename from templates/http-kv-service-hono/rolldown.config.mjs rename to templates/http-handler-hono/rolldown.config.mjs diff --git a/templates/http-kv-service-hono/src/component.ts b/templates/http-handler-hono/src/component.ts similarity index 98% rename from templates/http-kv-service-hono/src/component.ts rename to templates/http-handler-hono/src/component.ts index a73028b7..e99491e8 100644 --- a/templates/http-kv-service-hono/src/component.ts +++ b/templates/http-handler-hono/src/component.ts @@ -49,9 +49,9 @@ app.use('*', async (c, next) => { // API information app.get('/', (c) => { return c.json({ - name: 'Hono HTTP Service', + name: 'Hono HTTP Handler', version: '1.0.0', - description: 'A comprehensive HTTP service built with Hono on wasmCloud', + description: 'A comprehensive HTTP handler built with Hono on wasmCloud', endpoints: { '/': 'API information (this page)', '/health': 'Health check endpoint', diff --git a/templates/http-kv-service-hono/src/routes/echo.ts b/templates/http-handler-hono/src/routes/echo.ts similarity index 100% rename from templates/http-kv-service-hono/src/routes/echo.ts rename to templates/http-handler-hono/src/routes/echo.ts diff --git a/templates/http-service-hono/src/routes/items.ts b/templates/http-handler-hono/src/routes/items.ts similarity index 100% rename from templates/http-service-hono/src/routes/items.ts rename to templates/http-handler-hono/src/routes/items.ts diff --git a/templates/http-kv-service-hono/tsconfig.json b/templates/http-handler-hono/tsconfig.json similarity index 100% rename from templates/http-kv-service-hono/tsconfig.json rename to templates/http-handler-hono/tsconfig.json diff --git a/templates/http-service-hono/wit/world.wit b/templates/http-handler-hono/wit/world.wit similarity index 68% rename from templates/http-service-hono/wit/world.wit rename to templates/http-handler-hono/wit/world.wit index 230608de..abcd8052 100644 --- a/templates/http-service-hono/wit/world.wit +++ b/templates/http-handler-hono/wit/world.wit @@ -1,5 +1,5 @@ package wasmcloud:templates@0.1.0; -world typescript-http-service-hono { +world typescript-http-handler-hono { export wasi:http/incoming-handler@0.2.6; } diff --git a/templates/http-service-hono/wkg.lock b/templates/http-handler-hono/wkg.lock similarity index 100% rename from templates/http-service-hono/wkg.lock rename to templates/http-handler-hono/wkg.lock diff --git a/templates/http-logging-service-hono/.gitignore b/templates/http-kv-handler-hono/.gitignore similarity index 100% rename from templates/http-logging-service-hono/.gitignore rename to templates/http-kv-handler-hono/.gitignore diff --git a/templates/http-kv-service-hono/.wash/config.yaml b/templates/http-kv-handler-hono/.wash/config.yaml similarity index 55% rename from templates/http-kv-service-hono/.wash/config.yaml rename to templates/http-kv-handler-hono/.wash/config.yaml index 77cfea66..672c9386 100644 --- a/templates/http-kv-service-hono/.wash/config.yaml +++ b/templates/http-kv-handler-hono/.wash/config.yaml @@ -3,4 +3,4 @@ new: build: command: npm run build - component_path: dist/http_kv_service_hono.wasm + component_path: dist/http_kv_handler_hono.wasm diff --git a/templates/http-kv-service-hono/README.md b/templates/http-kv-handler-hono/README.md similarity index 91% rename from templates/http-kv-service-hono/README.md rename to templates/http-kv-handler-hono/README.md index 06208c0c..87b78763 100644 --- a/templates/http-kv-service-hono/README.md +++ b/templates/http-kv-handler-hono/README.md @@ -1,6 +1,6 @@ -# HTTP + Key-Value Service with Hono in TypeScript +# HTTP + Key-Value Handler with Hono in TypeScript -This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates a comprehensive HTTP service using the [Hono][hono] web framework, with persistent storage backed by [`wasi:keyvalue`][wasi-kv]. +This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates a comprehensive HTTP handler using the [Hono][hono] web framework, with persistent storage backed by [`wasi:keyvalue`][wasi-kv]. [wasi-kv]: https://github.com/WebAssembly/wasi-keyvalue @@ -30,11 +30,11 @@ This project also uses [`rolldown`][rolldown] to transpile Typescript and bundle Use `wash new` to scaffold a new wasmCloud component project: ```shell -wash new https://github.com/wasmCloud/typescript.git --name http-kv-service-hono --subfolder templates/http-kv-service-hono --git-ref v2 +wash new https://github.com/wasmCloud/typescript.git --name http-kv-handler-hono --subfolder templates/http-kv-handler-hono --git-ref v2 ``` ```shell -cd http-kv-service-hono +cd http-kv-handler-hono ``` To build this project and run in a hot-reloading development loop, run `npm run dev` from this directory: @@ -63,7 +63,7 @@ npm run dev ### Middleware -The service demonstrates several Hono middleware patterns: +The handler demonstrates several Hono middleware patterns: - **Request logging** - All requests are logged with timing information - **Response timing** - `X-Response-Time` header added to all responses @@ -110,7 +110,7 @@ curl -X POST http://localhost:8000/api/echo \ ### Error Handling -The service includes comprehensive error handling: +The handler includes comprehensive error handling: - **HTTPException** for structured error responses - **Custom 404 handler** with helpful error messages @@ -127,7 +127,7 @@ npm run build This component uses the following [WIT interfaces](https://component-model.bytecodealliance.org/design/wit.html): ```wit -world typescript-http-kv-service-hono { +world typescript-http-kv-handler-hono { import wasi:keyvalue/store@0.2.0-draft; import wasi:keyvalue/atomics@0.2.0-draft; diff --git a/templates/http-logging-service-hono/nodemon.json b/templates/http-kv-handler-hono/nodemon.json similarity index 100% rename from templates/http-logging-service-hono/nodemon.json rename to templates/http-kv-handler-hono/nodemon.json diff --git a/templates/http-service-hono/package-lock.json b/templates/http-kv-handler-hono/package-lock.json similarity index 99% rename from templates/http-service-hono/package-lock.json rename to templates/http-kv-handler-hono/package-lock.json index f90dccf9..d8654592 100644 --- a/templates/http-service-hono/package-lock.json +++ b/templates/http-kv-handler-hono/package-lock.json @@ -1,11 +1,11 @@ { - "name": "http-service-hono", + "name": "http-kv-handler-hono", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "http-service-hono", + "name": "http-kv-handler-hono", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { diff --git a/templates/http-kv-service-hono/package.json b/templates/http-kv-handler-hono/package.json similarity index 88% rename from templates/http-kv-service-hono/package.json rename to templates/http-kv-handler-hono/package.json index df3a6c61..3b99063d 100644 --- a/templates/http-kv-service-hono/package.json +++ b/templates/http-kv-handler-hono/package.json @@ -1,5 +1,5 @@ { - "name": "http-kv-service-hono", + "name": "http-kv-handler-hono", "version": "0.1.0", "description": "A WebAssembly component HTTP service using the Hono web framework and wasi:keyvalue", "private": true, @@ -10,9 +10,9 @@ "generate:types": "rimraf generated/types && jco guest-types wit/ -o generated/types", "setup:wit": "npm run fetch:wit && npm run generate:types", "build:ts": "rolldown -c rolldown.config.mjs", - "build:component": "jco componentize -w wit -o dist/http_kv_service_hono.wasm dist/component.js", + "build:component": "jco componentize -w wit -o dist/http_kv_handler_hono.wasm dist/component.js", "build": "npm run setup:wit && npm run build:ts && npm run build:component", - "serve": "jco serve dist/http_kv_service_hono.wasm", + "serve": "jco serve dist/http_kv_handler_hono.wasm", "dev": "nodemon" }, "keywords": [], diff --git a/templates/http-logging-service-hono/rolldown.config.mjs b/templates/http-kv-handler-hono/rolldown.config.mjs similarity index 100% rename from templates/http-logging-service-hono/rolldown.config.mjs rename to templates/http-kv-handler-hono/rolldown.config.mjs diff --git a/templates/http-service-hono/src/component.ts b/templates/http-kv-handler-hono/src/component.ts similarity index 98% rename from templates/http-service-hono/src/component.ts rename to templates/http-kv-handler-hono/src/component.ts index a73028b7..e99491e8 100644 --- a/templates/http-service-hono/src/component.ts +++ b/templates/http-kv-handler-hono/src/component.ts @@ -49,9 +49,9 @@ app.use('*', async (c, next) => { // API information app.get('/', (c) => { return c.json({ - name: 'Hono HTTP Service', + name: 'Hono HTTP Handler', version: '1.0.0', - description: 'A comprehensive HTTP service built with Hono on wasmCloud', + description: 'A comprehensive HTTP handler built with Hono on wasmCloud', endpoints: { '/': 'API information (this page)', '/health': 'Health check endpoint', diff --git a/templates/http-service-hono/src/routes/echo.ts b/templates/http-kv-handler-hono/src/routes/echo.ts similarity index 100% rename from templates/http-service-hono/src/routes/echo.ts rename to templates/http-kv-handler-hono/src/routes/echo.ts diff --git a/templates/http-kv-service-hono/src/routes/items.ts b/templates/http-kv-handler-hono/src/routes/items.ts similarity index 100% rename from templates/http-kv-service-hono/src/routes/items.ts rename to templates/http-kv-handler-hono/src/routes/items.ts diff --git a/templates/http-logging-service-hono/tsconfig.json b/templates/http-kv-handler-hono/tsconfig.json similarity index 100% rename from templates/http-logging-service-hono/tsconfig.json rename to templates/http-kv-handler-hono/tsconfig.json diff --git a/templates/http-kv-service-hono/wit/world.wit b/templates/http-kv-handler-hono/wit/world.wit similarity index 80% rename from templates/http-kv-service-hono/wit/world.wit rename to templates/http-kv-handler-hono/wit/world.wit index 13e19c1d..9e9e0855 100644 --- a/templates/http-kv-service-hono/wit/world.wit +++ b/templates/http-kv-handler-hono/wit/world.wit @@ -1,6 +1,6 @@ package wasmcloud:templates@0.1.0; -world typescript-http-kv-service-hono { +world typescript-http-kv-handler-hono { import wasi:keyvalue/store@0.2.0-draft; import wasi:keyvalue/atomics@0.2.0-draft; diff --git a/templates/http-kv-service-hono/wkg.lock b/templates/http-kv-handler-hono/wkg.lock similarity index 100% rename from templates/http-kv-service-hono/wkg.lock rename to templates/http-kv-handler-hono/wkg.lock diff --git a/templates/http-service-hono/.gitignore b/templates/http-logging-handler-hono/.gitignore similarity index 100% rename from templates/http-service-hono/.gitignore rename to templates/http-logging-handler-hono/.gitignore diff --git a/templates/http-logging-service-hono/.wash/config.yaml b/templates/http-logging-handler-hono/.wash/config.yaml similarity index 53% rename from templates/http-logging-service-hono/.wash/config.yaml rename to templates/http-logging-handler-hono/.wash/config.yaml index 34634175..e29e3540 100644 --- a/templates/http-logging-service-hono/.wash/config.yaml +++ b/templates/http-logging-handler-hono/.wash/config.yaml @@ -3,4 +3,4 @@ new: build: command: npm run build - component_path: dist/http_logging_service_hono.wasm + component_path: dist/http_logging_handler_hono.wasm diff --git a/templates/http-logging-service-hono/README.md b/templates/http-logging-handler-hono/README.md similarity index 91% rename from templates/http-logging-service-hono/README.md rename to templates/http-logging-handler-hono/README.md index e8e0b2e4..a8859e56 100644 --- a/templates/http-logging-service-hono/README.md +++ b/templates/http-logging-handler-hono/README.md @@ -1,6 +1,6 @@ -# HTTP Logging Service with Hono in TypeScript +# HTTP Logging Handler with Hono in TypeScript -This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates structured logging via [`wasi:logging`][wasi-logging] in a [Hono][hono] HTTP service running on wasmCloud. +This project template is a WebAssembly component built with [TypeScript][ts] that demonstrates structured logging via [`wasi:logging`][wasi-logging] in a [Hono][hono] HTTP handler running on wasmCloud. Every request and response is logged at the appropriate level (`trace`, `debug`, `info`, `warn`, `error`, `critical`) so you can see exactly how WASI logging integrates with the wasmCloud host's structured log output. @@ -26,8 +26,8 @@ Every request and response is logged at the appropriate level (`trace`, `debug`, Use `wash new` to scaffold a new project from this template: ```shell -wash new https://github.com/wasmCloud/typescript.git --name http-logging-service-hono --subfolder templates/http-logging-service-hono -cd http-logging-service-hono +wash new https://github.com/wasmCloud/typescript.git --name http-logging-handler-hono --subfolder templates/http-logging-handler-hono +cd http-logging-handler-hono ``` Start the hot-reloading development loop: @@ -77,7 +77,7 @@ WARN <-- GET /missing 404 0ms requestId=e1bf36e2 context="http" ## WIT Interfaces ```wit -world typescript-http-logging-service-hono { +world typescript-http-logging-handler-hono { import wasi:logging/logging@0.1.0-draft; export wasi:http/incoming-handler@0.2.6; diff --git a/templates/http-service-hono/nodemon.json b/templates/http-logging-handler-hono/nodemon.json similarity index 100% rename from templates/http-service-hono/nodemon.json rename to templates/http-logging-handler-hono/nodemon.json diff --git a/templates/http-logging-service-hono/package-lock.json b/templates/http-logging-handler-hono/package-lock.json similarity index 99% rename from templates/http-logging-service-hono/package-lock.json rename to templates/http-logging-handler-hono/package-lock.json index 938cec05..662a809d 100644 --- a/templates/http-logging-service-hono/package-lock.json +++ b/templates/http-logging-handler-hono/package-lock.json @@ -1,11 +1,11 @@ { - "name": "http-logging-service-hono", + "name": "http-logging-handler-hono", "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "http-logging-service-hono", + "name": "http-logging-handler-hono", "version": "0.1.0", "license": "Apache-2.0", "dependencies": { diff --git a/templates/http-logging-service-hono/package.json b/templates/http-logging-handler-hono/package.json similarity index 86% rename from templates/http-logging-service-hono/package.json rename to templates/http-logging-handler-hono/package.json index a1333031..cd0a82be 100644 --- a/templates/http-logging-service-hono/package.json +++ b/templates/http-logging-handler-hono/package.json @@ -1,5 +1,5 @@ { - "name": "http-logging-service-hono", + "name": "http-logging-handler-hono", "version": "0.1.0", "description": "A WebAssembly component HTTP service using the Hono web framework and wasi:logging", "private": true, @@ -10,9 +10,9 @@ "generate:types": "rimraf generated/types && jco guest-types wit/ -o generated/types", "setup:wit": "npm run fetch:wit && npm run generate:types", "build:ts": "rolldown -c rolldown.config.mjs", - "build:component": "jco componentize -w wit -o dist/http_logging_service_hono.wasm dist/component.js", + "build:component": "jco componentize -w wit -o dist/http_logging_handler_hono.wasm dist/component.js", "build": "npm run setup:wit && npm run build:ts && npm run build:component", - "serve": "jco serve dist/http_logging_service_hono.wasm", + "serve": "jco serve dist/http_logging_handler_hono.wasm", "dev": "nodemon" }, "keywords": [], diff --git a/templates/http-service-hono/rolldown.config.mjs b/templates/http-logging-handler-hono/rolldown.config.mjs similarity index 100% rename from templates/http-service-hono/rolldown.config.mjs rename to templates/http-logging-handler-hono/rolldown.config.mjs diff --git a/templates/http-logging-service-hono/src/component.ts b/templates/http-logging-handler-hono/src/component.ts similarity index 96% rename from templates/http-logging-service-hono/src/component.ts rename to templates/http-logging-handler-hono/src/component.ts index abc65679..ad5ab200 100644 --- a/templates/http-logging-service-hono/src/component.ts +++ b/templates/http-logging-handler-hono/src/component.ts @@ -37,9 +37,9 @@ app.use('*', async (c, next) => { app.get('/', (c) => c.json({ - name: 'HTTP Logging Service', + name: 'HTTP Logging Handler', version: '1.0.0', - description: 'A Hono service on wasmCloud demonstrating WASI structured logging', + description: 'A Hono handler on wasmCloud demonstrating WASI structured logging', endpoints: { '/': 'API info', '/health': 'Health check' }, }), ); diff --git a/templates/http-service-hono/tsconfig.json b/templates/http-logging-handler-hono/tsconfig.json similarity index 100% rename from templates/http-service-hono/tsconfig.json rename to templates/http-logging-handler-hono/tsconfig.json diff --git a/templates/http-logging-service-hono/wit/world.wit b/templates/http-logging-handler-hono/wit/world.wit similarity index 73% rename from templates/http-logging-service-hono/wit/world.wit rename to templates/http-logging-handler-hono/wit/world.wit index b51b5f98..bc1cc0e1 100644 --- a/templates/http-logging-service-hono/wit/world.wit +++ b/templates/http-logging-handler-hono/wit/world.wit @@ -1,6 +1,6 @@ package wasmcloud:templates@0.1.0; -world typescript-http-kv-service-hono { +world typescript-http-logging-handler-hono { import wasi:logging/logging@0.1.0-draft; export wasi:http/incoming-handler@0.2.6; diff --git a/templates/http-logging-service-hono/wkg.lock b/templates/http-logging-handler-hono/wkg.lock similarity index 100% rename from templates/http-logging-service-hono/wkg.lock rename to templates/http-logging-handler-hono/wkg.lock