Skip to main content
grasp.study
About
Explore
Pricing
Log in
Try it for free
Back to course
👋
Welcome to a Grasp lesson
Create a free account
to keep studying and create your own study path.
Cloudflare Full-Stack Development
·
Module 6
المشروع الأول: أداة تقصير الروابط (URL Shortener) باستخدام Hono, Zod, and KV
1
Cloudflare KV Namespace Binding for Workers
Create a Cloudflare KV namespace and bind it to the Worker for key-value data storage.
2
Creating a Validated Hono Endpoint for URL Shortening
Design a Hono endpoint that accepts a long URL, validates it with Zod, and returns a validation error if invalid.
3
Creating Short Codes with KV and TTL
Generate a unique short code and store the `shortCode -> longURL` mapping in the KV namespace with a TTL.
4
Building a URL Redirect with KV and HTTP 302
Implement a redirect endpoint that retrieves the original URL from KV using the short code and performs an HTTP 302 redirect.
5
Listing Short Codes with KV and Pagination
Implement an endpoint to list all stored short codes using KV's `list` functionality with pagination.
6
Deploy and Test Your Cloudflare URL Shortener
Deploy the complete URL shortener application to Cloudflare and test all functionalities on the live URL.
Previous module
التحقق من صحة البيانات باستخدام Zod
Next module
قواعد البيانات العلائقية على الحافة (Edge) باستخدام D1