diff --git a/content/api/hub/ab_cookie_sample.md b/content/api/hub/ab_cookie_sample.md new file mode 100644 index 00000000..dc2aa263 --- /dev/null +++ b/content/api/hub/ab_cookie_sample.md @@ -0,0 +1,30 @@ +title = "Cookie based A/B Testing" +template = "render_hub_content_body" +date = "2025-01-24T00:00:00Z" +content-type = "text/plain" +tags = ["http", "Rust"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "Rust" +created_at = "2025-01-21T13:50:00Z" +last_updated = "2025-01-21T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "A Spin application showcasing how to implement A/B testing based on a cookie." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/ab-testing-cookie" +keywords = "Rust, HTTP" + +--- + +This sample application shows how you can use a Spin application to implement A/B testing based on a cookie. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- Rust tools and the `wasm32-wasip1` target +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/ab_keyvalue_sample.md b/content/api/hub/ab_keyvalue_sample.md new file mode 100644 index 00000000..e15630d8 --- /dev/null +++ b/content/api/hub/ab_keyvalue_sample.md @@ -0,0 +1,30 @@ +title = "KeyValue based A/B Testing" +template = "render_hub_content_body" +date = "2025-01-24T00:00:00Z" +content-type = "text/plain" +tags = ["http", "Rust", "key value"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "Rust" +created_at = "2025-01-21T13:50:00Z" +last_updated = "2025-01-21T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "A Spin application showcasing how to implement A/B testing based on data in a Key Value store." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/ab-testing-kv" +keywords = "Rust, HTTP, Key Value" + +--- + +This sample application shows how you can use a Spin application to implement A/B testing based on a cookie. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- Rust tools and the `wasm32-wasip1` target +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/ab_user_agent_sample.md b/content/api/hub/ab_user_agent_sample.md new file mode 100644 index 00000000..f0f6767c --- /dev/null +++ b/content/api/hub/ab_user_agent_sample.md @@ -0,0 +1,30 @@ +title = "User Agent based A/B Testing" +template = "render_hub_content_body" +date = "2025-01-24T00:00:00Z" +content-type = "text/plain" +tags = ["http", "Rust"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "Rust" +created_at = "2025-01-21T13:50:00Z" +last_updated = "2025-01-21T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "A Spin application showcasing how to implement A/B testing based on the user agent." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/ab-testing-user-agent" +keywords = "Rust, HTTP" + +--- + +This sample application shows how you can use a Spin application to implement A/B testing based on a cookie. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- Rust tools and the `wasm32-wasip1` target +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/aggregate_json_sample.md b/content/api/hub/aggregate_json_sample.md new file mode 100644 index 00000000..ba1fea64 --- /dev/null +++ b/content/api/hub/aggregate_json_sample.md @@ -0,0 +1,30 @@ +title = "Aggregate JSON" +template = "render_hub_content_body" +date = "2025-01-20T00:00:00Z" +content-type = "text/plain" +tags = ["http", "typescript"] + +[extra] +author = "Fermyon" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-20T00:00:00Z" +last_updated = "2025-01-20T00:00:00Z" +spin_version = ">=v3.1.0" +summary = "Shows how to make concurrent outgoing requests and aggregate the responses." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/aggregate-json" +keywords = "TypeScript, HTTP" + +--- + +This sample shows how to make concurrent outgoing HTTP requests and combine the results. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- A recent version of `npm` +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/alter_response_headers_sample.md b/content/api/hub/alter_response_headers_sample.md new file mode 100644 index 00000000..862e85cd --- /dev/null +++ b/content/api/hub/alter_response_headers_sample.md @@ -0,0 +1,31 @@ +title = "Altering Response Headers" +template = "render_hub_content_body" +date = "2025-01-20T00:00:00Z" +content-type = "text/plain" +tags = ["http", "typescript"] + +[extra] +author = "Fermyon" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-20T00:00:00Z" +last_updated = "2025-01-20T00:00:00Z" +spin_version = ">=v3.1.0" +summary = "Shows how to alter response headers." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/alter-headers" +keywords = "TypeScript, HTTP" + +--- + +This sample application shows how to alter the headers as you stream a response from an origin +server back to a client. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- A recent version of `npm` +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/autocomplete_sample.md b/content/api/hub/autocomplete_sample.md new file mode 100644 index 00000000..de60225b --- /dev/null +++ b/content/api/hub/autocomplete_sample.md @@ -0,0 +1,30 @@ +title = "Autocomplete API" +template = "render_hub_content_body" +date = "2025-01-24T00:00:00Z" +content-type = "text/plain" +tags = ["http", "Rust"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "Rust" +created_at = "2025-01-21T13:50:00Z" +last_updated = "2025-01-21T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "Implement an autocomplete API using Spin and Rust." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/auto-complete/autocomplete" +keywords = "Rust, HTTP" + +--- + +This sample application shows how you can use a Spin application to implement an autocomplete API. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- Rust tools and the `wasm32-wasip1` target +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/bulk_redirects_sample.md b/content/api/hub/bulk_redirects_sample.md new file mode 100644 index 00000000..3ec0c516 --- /dev/null +++ b/content/api/hub/bulk_redirects_sample.md @@ -0,0 +1,31 @@ +title = "Bulk Redirects" +template = "render_hub_content_body" +date = "2025-01-20T00:00:00Z" +content-type = "text/plain" +tags = ["http", "typescript"] + +[extra] +author = "Fermyon" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-20T00:00:00Z" +last_updated = "2025-01-20T00:00:00Z" +spin_version = ">=v3.1.0" +summary = "Shows how to redirect requests." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/bulk-redirects" +keywords = "TypeScript, HTTP" + +--- + +This application shows how you can bulk-redirect requests using a JavaScript object to map inbound routes +to their new locations. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- A recent version of `npm` +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/early_hint_sample.md b/content/api/hub/early_hint_sample.md new file mode 100644 index 00000000..8275db37 --- /dev/null +++ b/content/api/hub/early_hint_sample.md @@ -0,0 +1,31 @@ +title = "HarperDB and 103 Early Hints in Rust" +template = "render_hub_content_body" +date = "2025-01-29T00:00:00Z" +content-type = "text/plain" +tags = ["http", "Rust"] + +[extra] +author = "Radu Matei" +type = "hub_document" +category = "Sample" +language = "Rust" +created_at = "2025-01-29T13:50:00Z" +last_updated = "2025-01-29T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "This sample showcases using using Fermyon Wasm Functions to query HarperDB for early hints." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/early-hints-rust" +keywords = "Rust, HTTP" + +--- + +This sample showcases using using Fermyon Wasm Functions to query HarperDB for early hints. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- Rust tools and the `wasm32-wasip1` target +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ +- Access to a HarperDB instance diff --git a/content/api/hub/key_value_tutorial.md b/content/api/hub/key_value_tutorial.md new file mode 100644 index 00000000..a5498113 --- /dev/null +++ b/content/api/hub/key_value_tutorial.md @@ -0,0 +1,30 @@ +title = "Tutorial: Using the Key Value Store" +template = "render_hub_content_body" +date = "2025-01-21T13:50:00Z" +content-type = "text/plain" +tags = ["http", "Javascript", "key value"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-21T13:50:00Z" +last_updated = "2025-01-21T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "The sample application written as part of the Using the Key Value Store tutorial." +url = "https://github.com/fermyon/enterprise-architectures-and-patterns/tree/main/cqrs-rust" +keywords = "Javascript, HTTP, Key Value" + +--- + +This sample application was written as part of the [Using the Key Value Store](https://wasm-functions.fermyon.app/wasm-functions/using-key-value-store) tutorial. It showcases how to use the Spin Key-Value store from a Javascript-based Spin application, and guides you on installing it to Fermyon Wasm Functions on Akamai. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- Node.js (Version `20` or later) +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/limit_access_sample.md b/content/api/hub/limit_access_sample.md new file mode 100644 index 00000000..2976bb2d --- /dev/null +++ b/content/api/hub/limit_access_sample.md @@ -0,0 +1,32 @@ +title = "Limit Access" +template = "render_hub_content_body" +date = "2025-01-20T00:00:00Z" +content-type = "text/plain" +tags = ["http", "typescript"] + +[extra] +author = "Fermyon" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-20T00:00:00Z" +last_updated = "2025-01-20T00:00:00Z" +spin_version = ">=v3.1.0" +summary = "Shows how to limit access to an origin server." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/limit-access" +keywords = "TypeScript, HTTP" + +--- + +This sample application shows how to limit access to a given origin until a configuration point in time. +Before that point in time, the Spin application responds to all requests with a configurable status code; +after it, the Spin application acts as a transparent proxy. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- A recent version of `npm` +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/mysql_tutorial.md b/content/api/hub/mysql_tutorial.md new file mode 100644 index 00000000..b79dba92 --- /dev/null +++ b/content/api/hub/mysql_tutorial.md @@ -0,0 +1,30 @@ +title = "Tutorial: Querying MySQL" +template = "render_hub_content_body" +date = "2025-01-21T13:50:00Z" +content-type = "text/plain" +tags = ["http", "typescript", "sql", "mysql"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-21T13:50:00Z" +last_updated = "2025-01-21T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "The sample application written as part of the Querying MySQL tutorial." +url = "https://github.com/fermyon/fwf-examples/tree/main/tutorials/mysql-tutorial" +keywords = "TypeScript, HTTP, PostgreSQL, MySQL" + +--- + +The sample application written as part of the Querying MySQL tutorial. +Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to Fermyon Wasm Functions: + + The spin CLI + Node.js (Version 20 or later) + The aka plugin for spin CLI + Access to a MySQL database server (As part of the tutorial, we're using a Linode Managed Database) + Access to Fermyon Wasm Functions diff --git a/content/api/hub/object_storage_streaming_sample.md b/content/api/hub/object_storage_streaming_sample.md new file mode 100644 index 00000000..abc30a17 --- /dev/null +++ b/content/api/hub/object_storage_streaming_sample.md @@ -0,0 +1,29 @@ +title = "Object Storage Streaming and Transformation" +template = "render_hub_content_body" +date = "2025-01-29T00:00:00Z" +content-type = "text/plain" +tags = ["http", "Typescript", "streaming"] + +[extra] +author = "Radu Matei" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-29T13:50:00Z" +last_updated = "2025-01-29T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "A Spin application showcasing how to stream and transform an object from an object store." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/linode-object-storage-streaming" +keywords = "Typescript, HTTP" + +--- + +This sample application shows how to stream and transform an object from an object store. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/read_post_sample.md b/content/api/hub/read_post_sample.md new file mode 100644 index 00000000..840336d9 --- /dev/null +++ b/content/api/hub/read_post_sample.md @@ -0,0 +1,30 @@ +title = "Read a POST Body" +template = "render_hub_content_body" +date = "2025-01-20T00:00:00Z" +content-type = "text/plain" +tags = ["http", "typescript"] + +[extra] +author = "Fermyon" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-20T00:00:00Z" +last_updated = "2025-01-20T00:00:00Z" +spin_version = ">=v3.1.0" +summary = "Shows how to read the body of a POST request." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/read-post" +keywords = "TypeScript, HTTP" + +--- + +This sample application illustrates how to read the body of an HTTP POST request. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- A recent version of `npm` +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/relational_db_tutorial.md b/content/api/hub/relational_db_tutorial.md new file mode 100644 index 00000000..a079f159 --- /dev/null +++ b/content/api/hub/relational_db_tutorial.md @@ -0,0 +1,30 @@ +title = "Tutorial: Querying relational Databases" +template = "render_hub_content_body" +date = "2025-01-21T13:50:00Z" +content-type = "text/plain" +tags = ["http", "javascript", "sql", "postgres"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-21T13:50:00Z" +last_updated = "2025-01-21T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "The sample application written as part of the Querying relational Databases tutorial." +url = "https://github.com/fermyon/fwf-examples/tree/main/tutorials/postgresql-tutorial" +keywords = "Javascript, HTTP, PostgreSQL, Postgres" + +--- + +The sample application written as part of the Querying relational Databases tutorial. +Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to Fermyon Wasm Functions: + + The spin CLI + Node.js (Version 20 or later) + The aka plugin for spin CLI + Access to a PostgreSQL database server (As part of the tutorial, we're using NEON's free tier) + Access to Fermyon Wasm Functions diff --git a/content/api/hub/respond_with_other_site_sample.md b/content/api/hub/respond_with_other_site_sample.md new file mode 100644 index 00000000..c928fb09 --- /dev/null +++ b/content/api/hub/respond_with_other_site_sample.md @@ -0,0 +1,30 @@ +title = "Respond with Another Site" +template = "render_hub_content_body" +date = "2025-01-20T00:00:00Z" +content-type = "text/plain" +tags = ["http", "typescript"] + +[extra] +author = "Fermyon" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-01-20T00:00:00Z" +last_updated = "2025-01-20T00:00:00Z" +spin_version = ">=v3.1.0" +summary = "Shows how to fetch and pass through a response from another site." +url = "https://github.com/fermyon/fwf-examples/tree/main/samples/respond-with-another-site" +keywords = "TypeScript, HTTP" + +--- + +This sample application shows a Wasm function that responds to GET requests with the response from another site. + +## Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to _Fermyon Wasm Functions_: + +- The `spin` CLI +- A recent version of `npm` +- The `aka` plugin for `spin` CLI +- Access to _Fermyon Wasm Functions_ diff --git a/content/api/hub/supabase_proxy_tutorial.md b/content/api/hub/supabase_proxy_tutorial.md new file mode 100644 index 00000000..ca1d4447 --- /dev/null +++ b/content/api/hub/supabase_proxy_tutorial.md @@ -0,0 +1,31 @@ +title = "Tutorial: Supabase Cache Proxy" +template = "render_hub_content_body" +date = "2025-01-21T13:50:00Z" +content-type = "text/plain" +tags = ["http", "typescript", "keyvalue", "supabase", "cache"] + +[extra] +author = "Thorsten Hans" +type = "hub_document" +category = "Sample" +language = "JS/TS" +created_at = "2025-02-14T13:50:00Z" +last_updated = "2025-02-14T13:50:00Z" +spin_version = ">=v3.1.0" +summary = "The sample application written as part of the Building a Supabase Cache Proxy tutorial." +url = "https://github.com/fermyon/fwf-examples/tree/main/tutorials/supabase-proxy-tutorial" +keywords = "TypeScript, HTTP, Supabase, KeyValue" + +--- + +The sample application written as part of the Building a Supabase Cache Proxy tutorial. + +Prerequisites + +You need the following tools on your machine, to build, run and deploy the application to Fermyon Wasm Functions: + + The spin CLI + Node.js (Version 20 or later) + The aka plugin for spin CLI + Access to Supabase (As part of the tutorial, we're using the Supabase free tier) + Access to Fermyon Wasm Functions