Course lesson 12 · Smart Routing Service

Setting up the Data Service

One study unit · Read, recall, then practice · Original video 00:07:20

The course now moves from the dashboard’s lightweight backend to the separate data service. Its first responsibility is receiving a short-link ID and redirecting the visitor to a default or country-specific destination. The lesson starts with a minimal WorkerEntrypoint class, explaining event handlers and deploying a hello-world response before adding routing complexity.

Primary source: course video 12 · Supplied English subtitles · 00:07:20.

Understand the idea

What the course does

  1. Inspect the dashboard’s default destination and optional country overrides to define the required routing behavior.
  2. Open the data-service application and locate its source entrypoint and minimal fetch response.
  3. Compare the class-based entrypoint with the user application’s module-style Worker entrypoint.
  4. Inspect the available fetch, queue, and scheduled methods and discuss their trigger roles.
  5. Run the data service locally on the demonstrated port 8787, then deploy it using its simple Wrangler script.
  6. Open the deployed data-service URL and confirm hello world before introducing Hono.

Watch for

Recall before revealing

Why establish a working hello-world deployment before adding the redirect logic?

Reveal the explanation

It confirms the data service’s entrypoint and deployment setup independently, making later failures easier to attribute to the new functionality.

Try it

Run and deploy the data service, then name one responsibility that belongs here and one that stays in the user application.

Check your result

Both local and hosted URLs respond, and you assign public redirecting to the data service and link editing to the user application.

Practice prompts and answer checks are added teaching material. Answer from memory first, then compare and explain any difference.

Rewatch only what you need

Open this lesson in your original course library and seek to the times below. Videos are not hosted on this site.

Companion primary documentation: Cloudflare resource bindings. For recorded API names, commands, limits, and prices, check the version you use.

← Previous   Next →