Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

My Personal Website + URL Shortner using Next.js, Cloudflare Pages & KVNamespace

License

Notifications You must be signed in to change notification settings

caiostoduto/caios.pages.dev

Repository files navigation

My Personal Website + URL Shortner using Next.js, Cloudflare Pages & KVNamespace

Features

  • URL Shortener
  • Configurable Redirects (using Cloudflare KVNamespace)
  • Configurable Default Redirect (app/not-found.tsx)
  • Homepage

Try it

Getting Started

  1. Clone the repository
$ git clone [email protected]:caiostoduto/caios.pages.dev.git
$ cd caios.pages.dev
  1. Install dependencies
$ pnpm install
  1. Create a new Cloudflare KVNamespace
$ pnpm wrangler kv:namespace create REDIRECT
  1. Deploy the worker
$ pnpm run pages:deploy
  1. Enable Node.js from the Cloudflare dashboard

  2. Bind your KV namespace to your Pages Function (Repeat step 4 after enabling 'nodejs_compat')

  3. Add your redirect routes to the KVNamespace (suggest using Cloudflare KVNamespace Dashboard)
    must include '/' (default) route

Image from Cloudflare Pages Dashboard setting kv routes

About

My Personal Website + URL Shortner using Next.js, Cloudflare Pages & KVNamespace

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published