From 7f7574b54e8316002f675628b1497c9ac1d24d19 Mon Sep 17 00:00:00 2001 From: quyumkehinde Date: Fri, 28 Mar 2025 10:05:57 +0100 Subject: [PATCH 1/2] feat: added fwf examples Signed-off-by: quyumkehinde --- content/api/hub/ab_cookie_sample.md | 30 +++++++++++++++ content/api/hub/ab_keyvalue_sample.md | 30 +++++++++++++++ content/api/hub/ab_user_agent_sample.md | 30 +++++++++++++++ content/api/hub/aggregate_json_sample.md | 30 +++++++++++++++ .../api/hub/alter_response_headers_sample.md | 31 +++++++++++++++ content/api/hub/autocomplete_sample.md | 30 +++++++++++++++ content/api/hub/bulk_redirects_sample.md | 31 +++++++++++++++ content/api/hub/early_hint_sample.md | 31 +++++++++++++++ content/api/hub/get_list copy.md | 9 +++++ content/api/hub/key_value_tutorial.md | 30 +++++++++++++++ content/api/hub/limit_access_sample.md | 32 ++++++++++++++++ content/api/hub/mysql_tutorial.md | 30 +++++++++++++++ .../hub/object_storage_streaming_sample.md | 29 ++++++++++++++ content/api/hub/read_post_sample.md | 30 +++++++++++++++ content/api/hub/relational_db_tutorial.md | 30 +++++++++++++++ .../api/hub/respond_with_other_site_sample.md | 30 +++++++++++++++ content/api/hub/supabase_proxy_tutorial.md | 31 +++++++++++++++ content/api/hub/template_http_empty copy.md | 24 ++++++++++++ content/api/hub/template_http_go copy.md | 25 ++++++++++++ content/api/hub/template_http_js copy.md | 25 ++++++++++++ content/api/hub/template_http_python copy.md | 35 +++++++++++++++++ content/api/hub/template_http_rust copy.md | 25 ++++++++++++ content/api/hub/template_http_ts copy.md | 25 ++++++++++++ content/api/hub/template_kv_explorer copy.md | 38 +++++++++++++++++++ 24 files changed, 691 insertions(+) create mode 100644 content/api/hub/ab_cookie_sample.md create mode 100644 content/api/hub/ab_keyvalue_sample.md create mode 100644 content/api/hub/ab_user_agent_sample.md create mode 100644 content/api/hub/aggregate_json_sample.md create mode 100644 content/api/hub/alter_response_headers_sample.md create mode 100644 content/api/hub/autocomplete_sample.md create mode 100644 content/api/hub/bulk_redirects_sample.md create mode 100644 content/api/hub/early_hint_sample.md create mode 100644 content/api/hub/get_list copy.md create mode 100644 content/api/hub/key_value_tutorial.md create mode 100644 content/api/hub/limit_access_sample.md create mode 100644 content/api/hub/mysql_tutorial.md create mode 100644 content/api/hub/object_storage_streaming_sample.md create mode 100644 content/api/hub/read_post_sample.md create mode 100644 content/api/hub/relational_db_tutorial.md create mode 100644 content/api/hub/respond_with_other_site_sample.md create mode 100644 content/api/hub/supabase_proxy_tutorial.md create mode 100644 content/api/hub/template_http_empty copy.md create mode 100644 content/api/hub/template_http_go copy.md create mode 100644 content/api/hub/template_http_js copy.md create mode 100644 content/api/hub/template_http_python copy.md create mode 100644 content/api/hub/template_http_rust copy.md create mode 100644 content/api/hub/template_http_ts copy.md create mode 100644 content/api/hub/template_kv_explorer copy.md 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/get_list copy.md b/content/api/hub/get_list copy.md new file mode 100644 index 00000000..db8f104e --- /dev/null +++ b/content/api/hub/get_list copy.md @@ -0,0 +1,9 @@ +title = "hub_list_api" +template = "hub_list_api" +date = "2022-10-15T00:22:56Z" +content_type = "application/json" + +[extra] +type = "get_list" + +--- 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 diff --git a/content/api/hub/template_http_empty copy.md b/content/api/hub/template_http_empty copy.md new file mode 100644 index 00000000..ce076d62 --- /dev/null +++ b/content/api/hub/template_http_empty copy.md @@ -0,0 +1,24 @@ +title = "Empty HTTP trigger template" +template = "render_hub_content_body" +date = "2022-10-15T00:22:56Z" +content-type = "text/html" +tags = ["http"] + +[extra] +author = "fermyon" +type = "hub_document" +category = "Template" +created_at = "2022-10-15T00:22:56Z" +last_updated = "2022-10-15T00:22:56Z" +spin_version = ">v0.7" +summary = "A template to create an HTTP application with no components" +url = "https://github.com/fermyon/spin/tree/main/templates/http-empty" +template_id = "http-empty" +repo_url = "https://github.com/fermyon/spin" +keywords = "web app, http, api, starter" + +--- + +This template creates an HTTP application with no components. It installs by default with the [Spin install script](../../spin/install#installing-spin). + +Use this template when you expect to [add](../../spin/writing-apps#adding-a-new-component-to-an-application) multiple components to an application, to help you establish an even directory structure. diff --git a/content/api/hub/template_http_go copy.md b/content/api/hub/template_http_go copy.md new file mode 100644 index 00000000..43972a43 --- /dev/null +++ b/content/api/hub/template_http_go copy.md @@ -0,0 +1,25 @@ +title = "Go HTTP trigger template" +template = "render_hub_content_body" +date = "2022-10-15T00:22:56Z" +content-type = "text/html" +tags = ["go", "http"] + +[extra] +author = "fermyon" +type = "hub_document" +category = "Template" +language = "Go" +created_at = "2022-10-15T00:22:56Z" +last_updated = "2022-10-15T00:22:56Z" +spin_version = ">v0.2" +summary = "A template to create an HTTP handler in Go" +url = "https://github.com/fermyon/spin/tree/main/templates/http-go" +template_id = "http-go" +repo_url = "https://github.com/fermyon/spin" +keywords = "web app, http, api" + +--- + +This is the default HTTP trigger template for Go. It installs by default with the [Spin install script](../../spin/install#installing-spin). + +This guide walks you through how to use it: [HTTP Components](../../spin/go-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_http_js copy.md b/content/api/hub/template_http_js copy.md new file mode 100644 index 00000000..436671e7 --- /dev/null +++ b/content/api/hub/template_http_js copy.md @@ -0,0 +1,25 @@ +title = "JavaScript HTTP trigger template" +template = "render_hub_content_body" +date = "2022-10-15T00:22:56Z" +content-type = "text/html" +tags = ["javascript", "http"] + +[extra] +author = "fermyon" +type = "hub_document" +category = "Template" +language = "JS/TS" +created_at = "2022-10-15T00:22:56Z" +last_updated = "2022-10-15T00:22:56Z" +spin_version = ">v0.8" +summary = "A template to create an HTTP handler in JavaScript" +url = "https://github.com/fermyon/spin-js-sdk/tree/main/templates/http-js" +template_id = "http-js" +repo_url = "https://github.com/fermyon/spin-js-sdk" +keywords = "web app, http, api" + +--- + +This is the default HTTP trigger template for JavaScript. It installs by default with the [Spin install script](../../spin/install#installing-spin). + +This guide walks you through how to use it: [HTTP Components](../../spin/javascript-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_http_python copy.md b/content/api/hub/template_http_python copy.md new file mode 100644 index 00000000..3e406a6a --- /dev/null +++ b/content/api/hub/template_http_python copy.md @@ -0,0 +1,35 @@ +title = "Python HTTP trigger template" +template = "render_hub_content_body" +date = "2022-10-15T00:22:56Z" +content-type = "text/html" +tags = ["python", "http"] + +[extra] +author = "fermyon" +type = "hub_document" +category = "Template" +language = "Python" +created_at = "2022-10-15T00:22:56Z" +last_updated = "2022-10-15T00:22:56Z" +spin_version = ">v2.2" +summary = "A template to create an HTTP handler in Python" +url = "https://github.com/fermyon/spin-python-sdk/tree/main/templates/http-py" +template_id = "http-py" +repo_url = "https://github.com/fermyon/spin-python-sdk" +keywords = "web app, http, api" + +--- + +## Prerequisite + +Ensure that you have Python 3.10 or later installed on your system. You can check your Python version by running: + +```bash +python3 --version +``` + +If you do not have Python 3.10 or later, you can install it by following the instructions [here](https://www.python.org/downloads/). + +This is the default HTTP trigger template for Python. It installs by default with the [Spin install script](../../spin/install#installing-spin). + +This guide walks you through how to use it: [Structure of a Python Component](../../spin/python-components#structure-of-a-python-component) \ No newline at end of file diff --git a/content/api/hub/template_http_rust copy.md b/content/api/hub/template_http_rust copy.md new file mode 100644 index 00000000..ad6c54c1 --- /dev/null +++ b/content/api/hub/template_http_rust copy.md @@ -0,0 +1,25 @@ +title = "Rust HTTP trigger template" +template = "render_hub_content_body" +date = "2022-10-15T00:22:56Z" +content-type = "text/html" +tags = ["rust", "http"] + +[extra] +author = "fermyon" +type = "hub_document" +category = "Template" +language = "Rust" +created_at = "2022-10-15T00:22:56Z" +last_updated = "2022-10-15T00:22:56Z" +spin_version = ">v0.2" +summary = "A template to create an HTTP handler in Rust" +url = "https://github.com/fermyon/spin/tree/main/templates/http-rust" +template_id = "http-rust" +repo_url = "https://github.com/fermyon/spin" +keywords = "web app, http, api" + +--- + +This is the default HTTP trigger template for Rust. It installs by default with the [Spin install script](../../spin/install#installing-spin). + +This guide walks you through how to use it: [HTTP Components](../../spin/rust-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_http_ts copy.md b/content/api/hub/template_http_ts copy.md new file mode 100644 index 00000000..1055e1f3 --- /dev/null +++ b/content/api/hub/template_http_ts copy.md @@ -0,0 +1,25 @@ +title = "TypeScript HTTP trigger template" +template = "render_hub_content_body" +date = "2022-10-15T00:22:56Z" +content-type = "text/html" +tags = ["typescript", "http"] + +[extra] +author = "fermyon" +type = "hub_document" +category = "Template" +language = "JS/TS" +created_at = "2022-10-15T00:22:56Z" +last_updated = "2022-10-15T00:22:56Z" +spin_version = ">v0.8" +summary = "A template to create an HTTP handler in TypeScript" +url = "https://github.com/fermyon/spin-js-sdk/tree/main/templates/http-ts" +template_id = "http-ts" +repo_url = "https://github.com/fermyon/spin-js-sdk" +keywords = "web app, http, api" + +--- + +This is the default HTTP trigger template for TypeScript. It installs by default with the [Spin install script](../../spin/install#installing-spin). + +This guide walks you through how to use it: [HTTP Components](../../spin/javascript-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_kv_explorer copy.md b/content/api/hub/template_kv_explorer copy.md new file mode 100644 index 00000000..fccef9d4 --- /dev/null +++ b/content/api/hub/template_kv_explorer copy.md @@ -0,0 +1,38 @@ +title = "Key value explorer template" +template = "render_hub_content_body" +date = "2023-07-24T00:22:56Z" +content-type = "text/html" +tags = ["go", "http", "kv"] + +[extra] +author = "radu-matei" +type = "hub_document" +category = "Template" +language = "Go" +created_at = "2023-10-15T00:22:56Z" +last_updated = "2023-05-18T00:22:56Z" +spin_version = ">=v1.0" +summary = "A Spin component for exploring the contents of key/value stores." +url = "https://github.com/fermyon/spin-kv-explorer" +template_id = "kv-explorer" +repo_url = "https://github.com/fermyon/spin-kv-explorer" +keywords = "key-value, kv, explorer" + +--- + +This template enables managing the key value pairs set in any key value store linked to an application. + +To keep the contents of your key value store secure, the explorer expects the credentials to access the UI and the API to be stored in the configuration store as variables. Values can be set locally using the [variables provider](../../spin/v2/dynamic-configuration#application-variables-runtime-configuration) or you can skip checking for the credentials on every request by passing the `SPIN_APP_KV_SKIP_AUTH` environment variable. When deploying to cloud, set the `kv_explorer_user` and `kv_explorer_password` variables using the `--variable` flag. These credentials can then be updated at any time using `spin cloud variables set`. + +Visit the [GitHub repo](https://github.com/fermyon/spin-kv-explorer) for complete configuration instructions. + +## Installation and Use + +```sh +spin templates install --upgrade --git https://github.com/fermyon/spin-kv-explorer +``` + +Use the `spin add` command to add the KV explorer to your application, specifying `kv-explorer` as the component name. +```sh +spin add kv-explorer -t kv-explorer +``` From 026bda63b6b1c71a1abe33215d3426ac7119f8ba Mon Sep 17 00:00:00 2001 From: quyumkehinde Date: Fri, 25 Apr 2025 16:10:07 +0100 Subject: [PATCH 2/2] chore: removed copy files Signed-off-by: quyumkehinde --- content/api/hub/get_list copy.md | 9 ----- content/api/hub/template_http_empty copy.md | 24 ------------- content/api/hub/template_http_go copy.md | 25 ------------- content/api/hub/template_http_js copy.md | 25 ------------- content/api/hub/template_http_python copy.md | 35 ------------------ content/api/hub/template_http_rust copy.md | 25 ------------- content/api/hub/template_http_ts copy.md | 25 ------------- content/api/hub/template_kv_explorer copy.md | 38 -------------------- 8 files changed, 206 deletions(-) delete mode 100644 content/api/hub/get_list copy.md delete mode 100644 content/api/hub/template_http_empty copy.md delete mode 100644 content/api/hub/template_http_go copy.md delete mode 100644 content/api/hub/template_http_js copy.md delete mode 100644 content/api/hub/template_http_python copy.md delete mode 100644 content/api/hub/template_http_rust copy.md delete mode 100644 content/api/hub/template_http_ts copy.md delete mode 100644 content/api/hub/template_kv_explorer copy.md diff --git a/content/api/hub/get_list copy.md b/content/api/hub/get_list copy.md deleted file mode 100644 index db8f104e..00000000 --- a/content/api/hub/get_list copy.md +++ /dev/null @@ -1,9 +0,0 @@ -title = "hub_list_api" -template = "hub_list_api" -date = "2022-10-15T00:22:56Z" -content_type = "application/json" - -[extra] -type = "get_list" - ---- diff --git a/content/api/hub/template_http_empty copy.md b/content/api/hub/template_http_empty copy.md deleted file mode 100644 index ce076d62..00000000 --- a/content/api/hub/template_http_empty copy.md +++ /dev/null @@ -1,24 +0,0 @@ -title = "Empty HTTP trigger template" -template = "render_hub_content_body" -date = "2022-10-15T00:22:56Z" -content-type = "text/html" -tags = ["http"] - -[extra] -author = "fermyon" -type = "hub_document" -category = "Template" -created_at = "2022-10-15T00:22:56Z" -last_updated = "2022-10-15T00:22:56Z" -spin_version = ">v0.7" -summary = "A template to create an HTTP application with no components" -url = "https://github.com/fermyon/spin/tree/main/templates/http-empty" -template_id = "http-empty" -repo_url = "https://github.com/fermyon/spin" -keywords = "web app, http, api, starter" - ---- - -This template creates an HTTP application with no components. It installs by default with the [Spin install script](../../spin/install#installing-spin). - -Use this template when you expect to [add](../../spin/writing-apps#adding-a-new-component-to-an-application) multiple components to an application, to help you establish an even directory structure. diff --git a/content/api/hub/template_http_go copy.md b/content/api/hub/template_http_go copy.md deleted file mode 100644 index 43972a43..00000000 --- a/content/api/hub/template_http_go copy.md +++ /dev/null @@ -1,25 +0,0 @@ -title = "Go HTTP trigger template" -template = "render_hub_content_body" -date = "2022-10-15T00:22:56Z" -content-type = "text/html" -tags = ["go", "http"] - -[extra] -author = "fermyon" -type = "hub_document" -category = "Template" -language = "Go" -created_at = "2022-10-15T00:22:56Z" -last_updated = "2022-10-15T00:22:56Z" -spin_version = ">v0.2" -summary = "A template to create an HTTP handler in Go" -url = "https://github.com/fermyon/spin/tree/main/templates/http-go" -template_id = "http-go" -repo_url = "https://github.com/fermyon/spin" -keywords = "web app, http, api" - ---- - -This is the default HTTP trigger template for Go. It installs by default with the [Spin install script](../../spin/install#installing-spin). - -This guide walks you through how to use it: [HTTP Components](../../spin/go-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_http_js copy.md b/content/api/hub/template_http_js copy.md deleted file mode 100644 index 436671e7..00000000 --- a/content/api/hub/template_http_js copy.md +++ /dev/null @@ -1,25 +0,0 @@ -title = "JavaScript HTTP trigger template" -template = "render_hub_content_body" -date = "2022-10-15T00:22:56Z" -content-type = "text/html" -tags = ["javascript", "http"] - -[extra] -author = "fermyon" -type = "hub_document" -category = "Template" -language = "JS/TS" -created_at = "2022-10-15T00:22:56Z" -last_updated = "2022-10-15T00:22:56Z" -spin_version = ">v0.8" -summary = "A template to create an HTTP handler in JavaScript" -url = "https://github.com/fermyon/spin-js-sdk/tree/main/templates/http-js" -template_id = "http-js" -repo_url = "https://github.com/fermyon/spin-js-sdk" -keywords = "web app, http, api" - ---- - -This is the default HTTP trigger template for JavaScript. It installs by default with the [Spin install script](../../spin/install#installing-spin). - -This guide walks you through how to use it: [HTTP Components](../../spin/javascript-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_http_python copy.md b/content/api/hub/template_http_python copy.md deleted file mode 100644 index 3e406a6a..00000000 --- a/content/api/hub/template_http_python copy.md +++ /dev/null @@ -1,35 +0,0 @@ -title = "Python HTTP trigger template" -template = "render_hub_content_body" -date = "2022-10-15T00:22:56Z" -content-type = "text/html" -tags = ["python", "http"] - -[extra] -author = "fermyon" -type = "hub_document" -category = "Template" -language = "Python" -created_at = "2022-10-15T00:22:56Z" -last_updated = "2022-10-15T00:22:56Z" -spin_version = ">v2.2" -summary = "A template to create an HTTP handler in Python" -url = "https://github.com/fermyon/spin-python-sdk/tree/main/templates/http-py" -template_id = "http-py" -repo_url = "https://github.com/fermyon/spin-python-sdk" -keywords = "web app, http, api" - ---- - -## Prerequisite - -Ensure that you have Python 3.10 or later installed on your system. You can check your Python version by running: - -```bash -python3 --version -``` - -If you do not have Python 3.10 or later, you can install it by following the instructions [here](https://www.python.org/downloads/). - -This is the default HTTP trigger template for Python. It installs by default with the [Spin install script](../../spin/install#installing-spin). - -This guide walks you through how to use it: [Structure of a Python Component](../../spin/python-components#structure-of-a-python-component) \ No newline at end of file diff --git a/content/api/hub/template_http_rust copy.md b/content/api/hub/template_http_rust copy.md deleted file mode 100644 index ad6c54c1..00000000 --- a/content/api/hub/template_http_rust copy.md +++ /dev/null @@ -1,25 +0,0 @@ -title = "Rust HTTP trigger template" -template = "render_hub_content_body" -date = "2022-10-15T00:22:56Z" -content-type = "text/html" -tags = ["rust", "http"] - -[extra] -author = "fermyon" -type = "hub_document" -category = "Template" -language = "Rust" -created_at = "2022-10-15T00:22:56Z" -last_updated = "2022-10-15T00:22:56Z" -spin_version = ">v0.2" -summary = "A template to create an HTTP handler in Rust" -url = "https://github.com/fermyon/spin/tree/main/templates/http-rust" -template_id = "http-rust" -repo_url = "https://github.com/fermyon/spin" -keywords = "web app, http, api" - ---- - -This is the default HTTP trigger template for Rust. It installs by default with the [Spin install script](../../spin/install#installing-spin). - -This guide walks you through how to use it: [HTTP Components](../../spin/rust-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_http_ts copy.md b/content/api/hub/template_http_ts copy.md deleted file mode 100644 index 1055e1f3..00000000 --- a/content/api/hub/template_http_ts copy.md +++ /dev/null @@ -1,25 +0,0 @@ -title = "TypeScript HTTP trigger template" -template = "render_hub_content_body" -date = "2022-10-15T00:22:56Z" -content-type = "text/html" -tags = ["typescript", "http"] - -[extra] -author = "fermyon" -type = "hub_document" -category = "Template" -language = "JS/TS" -created_at = "2022-10-15T00:22:56Z" -last_updated = "2022-10-15T00:22:56Z" -spin_version = ">v0.8" -summary = "A template to create an HTTP handler in TypeScript" -url = "https://github.com/fermyon/spin-js-sdk/tree/main/templates/http-ts" -template_id = "http-ts" -repo_url = "https://github.com/fermyon/spin-js-sdk" -keywords = "web app, http, api" - ---- - -This is the default HTTP trigger template for TypeScript. It installs by default with the [Spin install script](../../spin/install#installing-spin). - -This guide walks you through how to use it: [HTTP Components](../../spin/javascript-components#http-components) \ No newline at end of file diff --git a/content/api/hub/template_kv_explorer copy.md b/content/api/hub/template_kv_explorer copy.md deleted file mode 100644 index fccef9d4..00000000 --- a/content/api/hub/template_kv_explorer copy.md +++ /dev/null @@ -1,38 +0,0 @@ -title = "Key value explorer template" -template = "render_hub_content_body" -date = "2023-07-24T00:22:56Z" -content-type = "text/html" -tags = ["go", "http", "kv"] - -[extra] -author = "radu-matei" -type = "hub_document" -category = "Template" -language = "Go" -created_at = "2023-10-15T00:22:56Z" -last_updated = "2023-05-18T00:22:56Z" -spin_version = ">=v1.0" -summary = "A Spin component for exploring the contents of key/value stores." -url = "https://github.com/fermyon/spin-kv-explorer" -template_id = "kv-explorer" -repo_url = "https://github.com/fermyon/spin-kv-explorer" -keywords = "key-value, kv, explorer" - ---- - -This template enables managing the key value pairs set in any key value store linked to an application. - -To keep the contents of your key value store secure, the explorer expects the credentials to access the UI and the API to be stored in the configuration store as variables. Values can be set locally using the [variables provider](../../spin/v2/dynamic-configuration#application-variables-runtime-configuration) or you can skip checking for the credentials on every request by passing the `SPIN_APP_KV_SKIP_AUTH` environment variable. When deploying to cloud, set the `kv_explorer_user` and `kv_explorer_password` variables using the `--variable` flag. These credentials can then be updated at any time using `spin cloud variables set`. - -Visit the [GitHub repo](https://github.com/fermyon/spin-kv-explorer) for complete configuration instructions. - -## Installation and Use - -```sh -spin templates install --upgrade --git https://github.com/fermyon/spin-kv-explorer -``` - -Use the `spin add` command to add the KV explorer to your application, specifying `kv-explorer` as the component name. -```sh -spin add kv-explorer -t kv-explorer -```