diff --git a/content/workers/_partials/_tutorials-wrangler-v1-warning.md b/content/workers/_partials/_tutorials-wrangler-v1-warning.md new file mode 100644 index 0000000000000000000000000000000000000000..6e0f5ce0c5491b246f0534ae3af45df476a352d8 --- /dev/null +++ b/content/workers/_partials/_tutorials-wrangler-v1-warning.md @@ -0,0 +1,12 @@ +--- +_build: + publishResources: false + render: never + list: never +--- + +{{<Aside type="warning">}} + +This tutorial was developed with Wrangler v1, which has now been deprecated. Please see this [Migration guide](/workers/wrangler/migration/migrating-from-wrangler-1/) for instructions on how to migrate to the latest version. + +{{</Aside>}} diff --git a/content/workers/tutorials/build-a-jamstack-app/index.md b/content/workers/tutorials/build-a-jamstack-app/index.md index 156a22af21e807e97b4ed2425d0dc1db5edecf76..11b7a29fd52b5be295c58883691b061887c2af33 100644 --- a/content/workers/tutorials/build-a-jamstack-app/index.md +++ b/content/workers/tutorials/build-a-jamstack-app/index.md @@ -9,6 +9,8 @@ layout: single # Build a todo list JAMstack application +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/build-a-qr-code-generator/index.md b/content/workers/tutorials/build-a-qr-code-generator/index.md index 889c861052de61ec49526365768d418d40301b61..99e21ae2c79069fb1ca546ec8fab505de6272d21 100644 --- a/content/workers/tutorials/build-a-qr-code-generator/index.md +++ b/content/workers/tutorials/build-a-qr-code-generator/index.md @@ -9,6 +9,8 @@ layout: single # Build a QR code generator +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/build-a-slackbot/index.md b/content/workers/tutorials/build-a-slackbot/index.md index 77bbc19cc7b5702833f4afaaf2e74fe9f0bd8375..f83e0852c76352a855fda50cf99073e837c2581f 100644 --- a/content/workers/tutorials/build-a-slackbot/index.md +++ b/content/workers/tutorials/build-a-slackbot/index.md @@ -9,6 +9,8 @@ layout: single # Build a Slackbot +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/configure-your-cdn/index.md b/content/workers/tutorials/configure-your-cdn/index.md index d1ffd811ddf856dfbc8462e209a04de3781e24a0..f8fd79d3b0b8d26be627cd8ed4d63ccf091b877a 100644 --- a/content/workers/tutorials/configure-your-cdn/index.md +++ b/content/workers/tutorials/configure-your-cdn/index.md @@ -9,6 +9,8 @@ layout: single # Configure your CDN +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/github-sms-notifications-using-twilio/index.md b/content/workers/tutorials/github-sms-notifications-using-twilio/index.md index 16fe1815627f44285fddaa2e71e3c2ca3bee7a9f..0b3088352b8b272f952ccd6d9ff4a7d65a356f89 100644 --- a/content/workers/tutorials/github-sms-notifications-using-twilio/index.md +++ b/content/workers/tutorials/github-sms-notifications-using-twilio/index.md @@ -9,6 +9,8 @@ layout: single # GitHub SMS notifications using Twilio +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/handle-form-submissions-with-airtable/index.md b/content/workers/tutorials/handle-form-submissions-with-airtable/index.md index 46745e642a11c8ba8c5f65273805e0eb7aa599d8..a5e91dc62af408def064da9175dca872d01ba6d0 100644 --- a/content/workers/tutorials/handle-form-submissions-with-airtable/index.md +++ b/content/workers/tutorials/handle-form-submissions-with-airtable/index.md @@ -9,6 +9,8 @@ layout: single # Handle form submissions with Airtable +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/hello-world-rust/index.md b/content/workers/tutorials/hello-world-rust/index.md index e35fe97767e0867b44301e8ec6141e51f75872e3..79fefb7424be6d703b12e49b3d2368d0b9fe54b5 100644 --- a/content/workers/tutorials/hello-world-rust/index.md +++ b/content/workers/tutorials/hello-world-rust/index.md @@ -9,6 +9,8 @@ layout: single # Hello World in Rust +{{<render file="_tutorials-wrangler-v1-warning.md">}} + In this tutorial, you will learn how to generate, build, preview, configure, and publish a Rust-generated WebAssembly serverless function that parses Markdown for Cloudflare Workers. {{<render file="_tutorials-before-you-start.md">}} diff --git a/content/workers/tutorials/localize-a-website/index.md b/content/workers/tutorials/localize-a-website/index.md index e762ea2d37149d332968ff8e87869b1f4ecd9d05..9fba933c271c6e87417529ff5a392ae46ce0eccd 100644 --- a/content/workers/tutorials/localize-a-website/index.md +++ b/content/workers/tutorials/localize-a-website/index.md @@ -9,6 +9,8 @@ layout: single # Localize a website with HTMLRewriter +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/manage-projects-with-lerna/index.md b/content/workers/tutorials/manage-projects-with-lerna/index.md index eba532cac9b07c1b78756bcb1825f322a4e762d3..7f67f775327d2ca0ff1128c3a5f659b57e25b3a5 100644 --- a/content/workers/tutorials/manage-projects-with-lerna/index.md +++ b/content/workers/tutorials/manage-projects-with-lerna/index.md @@ -9,6 +9,8 @@ layout: single # Managing multiple Workers projects with Lerna +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/postgres/index.md b/content/workers/tutorials/postgres/index.md index 56720ea9106d366f9bfb1af3529508fa62ea127d..8b22bf278a57bc8dcc24e159bfc0632c5a49c0da 100644 --- a/content/workers/tutorials/postgres/index.md +++ b/content/workers/tutorials/postgres/index.md @@ -9,6 +9,8 @@ layout: single # Build data-driven applications with Workers and PostgreSQL +{{<render file="_tutorials-wrangler-v1-warning.md">}} + ## Overview Many applications for the web are built using industry standards like [PostgreSQL](https://postgresql.org), an open-source SQL database. Instead of directly connecting their user interface to that database, it is common for developers to use a back-end server to format and proxy API requests to that database. Rather than building a back-end server for this task, you will make use of Cloudflare Workers and an improvement to the PostgreSQL developer experience — [PostgREST](https://postgrest.org): a REST API built specifically for PostgreSQL. By doing this, you will handle API requests to your database without needing to maintain another piece of infrastructure. diff --git a/content/workers/tutorials/query-postgres-from-workers-using-database-connectors/index.md b/content/workers/tutorials/query-postgres-from-workers-using-database-connectors/index.md index 66c16543e59a83820e9bd25190df16ac89d40f2d..18de7549e9532c6f3f3dfc559bf94559c1e1bdd8 100644 --- a/content/workers/tutorials/query-postgres-from-workers-using-database-connectors/index.md +++ b/content/workers/tutorials/query-postgres-from-workers-using-database-connectors/index.md @@ -11,6 +11,8 @@ layout: single <TutorialsBeforeYouStart /> +{{<render file="_tutorials-wrangler-v1-warning.md">}} + ## Overview In this tutorial, you will learn how to retrieve data in your Cloudflare Workers applications from a PostgreSQL database using [Postgres database connector](https://github.com/cloudflare/worker-template-postgres). @@ -120,33 +122,33 @@ The template script includes a simple query to select a number (`SELECT 42;`) th // Parse the URL, and get the 'pagila-table' query parameter (which may not exist) const url = new URL(request.url); -const pagilaTable = url.searchParams.get('pagila-table'); +const pagilaTable = url.searchParams.get("pagila-table"); let result; // if pagilaTable is defined, run a query on the Pagila dataset if ( [ - 'actor', - 'address', - 'category', - 'city', - 'country', - 'customer', - 'film', - 'film_actor', - 'film_category', - 'inventory', - 'language', - 'payment', - 'payment_p2020_01', - 'payment_p2020_02', - 'payment_p2020_03', - 'payment_p2020_04', - 'payment_p2020_05', - 'payment_p2020_06', - 'rental', - 'staff', - 'store', + "actor", + "address", + "category", + "city", + "country", + "customer", + "film", + "film_actor", + "film_category", + "inventory", + "language", + "payment", + "payment_p2020_01", + "payment_p2020_02", + "payment_p2020_03", + "payment_p2020_04", + "payment_p2020_05", + "payment_p2020_06", + "rental", + "staff", + "store", ].includes(pagilaTable) ) { result = await client.queryObject(`SELECT * FROM ${pagilaTable};`); @@ -223,5 +225,6 @@ $ docker compose down If you found this tutorial useful, continue building with other Cloudflare Workers tutorials below. <!-- - [Authorize users with Auth0](/workers/tutorials/authorize-users-with-auth0/) --> + - [Build a Slackbot](/workers/tutorials/build-a-slackbot/) - [GitHub SMS notifications using Twilio](/workers/tutorials/github-sms-notifications-using-twilio/) diff --git a/content/workers/tutorials/store-data-with-fauna/index.md b/content/workers/tutorials/store-data-with-fauna/index.md index 68021e1a39d5b84e3eb8ae0a6db818df9191a6ae..7a3d2c697fd1619c47945fffca0f82bc465060ce 100644 --- a/content/workers/tutorials/store-data-with-fauna/index.md +++ b/content/workers/tutorials/store-data-with-fauna/index.md @@ -9,6 +9,8 @@ layout: single # Create a serverless, globally distributed REST API with Fauna +{{<render file="_tutorials-wrangler-v1-warning.md">}} + {{<render file="_tutorials-before-you-start.md">}} ## Overview diff --git a/content/workers/tutorials/workers-kv-from-rust/index.md b/content/workers/tutorials/workers-kv-from-rust/index.md index c28a95796e3a18764fd992652c081cb044682409..4152ab2277696e01a5b7f0f62a9f48d761035842 100644 --- a/content/workers/tutorials/workers-kv-from-rust/index.md +++ b/content/workers/tutorials/workers-kv-from-rust/index.md @@ -9,6 +9,8 @@ layout: single # Use Workers KV directly from Rust +{{<render file="_tutorials-wrangler-v1-warning.md">}} + In this tutorial, you will learn how to read and write to Workers KV directly from Rust, by using `wasm_bindgen` and a simple custom wrapper around the JS Workers KV API. {{<render file="_tutorials-before-you-start.md">}}