How to build a blog running on Cloudflare Workers at zero cost, with pictures and texts showing the process

How to build a blog running on Cloudflare Workers at zero cost, with pictures and texts showing the process

This is a blogging program that runs on Cloudflare Workers. It uses Cloudflare KV as the database, has no other dependencies, is compatible with the speed of static blogs, and has the flexibility of dynamic blogs, making it easy to build without any hassle.

Demo:

Cloudflare Workers: Go to https://dash.cloudflare.com/. You will enter a domain page with Workers at the top.

Main features <br /> Use KV provided by workers as database Use cloudflare to cache html to reduce KV reading and writing All html pages are cached, which can reach the speed of static blogs Use KV as database to achieve the flexibility of wordpress Use markdown syntax in the background, which is convenient and fast to publish with one click (page reconstruction + cache cleaning)

Carrying capacity
There is basically no bottleneck in KV because it uses cache and has very few reads and writes. The only bottleneck is the daily visit volume of workers, which is 100,000, and can withstand about 20,000 IPs/day. Number of articles: 1G storage space, tens of thousands of articles are not a big problem

Build steps

1. Create workers and KV
Create a new KV and a workers, and bind the KV. Note that the variable name CFBLOG is capitalized.

2. Domain name settings

Add a domain name DNS: for example, blog.zhujiwiki.com, the IP is arbitrary, and the orange cloud must be turned on. Bind the domain name to workers: Domain name -> workers -> Add route https://blog.zhujiwiki.com/*
Get the cache API token: Domain Overview -> Bottom right corner, record the zone ID, and get an API token for clearing the cache, as shown in the figure

3. Paste the index.js content in the source code to workers and modify the parameters as needed

4. Enter /admin to set up and publish articles

When publishing an article, please fill in all the information

Local backup: cloudflare-workers-blog-20201229

Reference: https://blog.gezhong.vip/article/000016/cloudflare-workers-blog.html
The project is open source: https://github.com/gdtool/cloudflare-workers-blog

<<:  Siyun Data: 999 yuan/month/4 cores/4GB memory/40GB NVMe space/unlimited traffic/60Mbps-110Mbps bandwidth/independent IP/KVM/Dongguan Telecom CN2

>>:  OneTechCloud: 20% off for New Year's Day, KVM VPS including Los Angeles Cera GIA/Los Angeles GIA

Recommend

Ramhost.us Web Hosting Coupon Code

It's a discount code for Easter. Coupon code:...

$30/year/512M/20G/1.5T/Xen – VIRPUS

VIRPUS is a long-established IDC service provider...

PulseHeberg: €5/month/2GB RAM/250GB storage/unlimited traffic/OpenVZ/France

PulseHeberg, founded in 2012, is a French hosting...

Quadcone 3GB RAM Xen VPS Los Angeles Review

Details : Quadcone: $5.3/month/3GB memory/50GB sp...

[Black Friday] SaltyFish: German GIA KVM VPS, 30% off for quarterly payment

SaltyFish.IO Cloud | Black Friday Sale 1 Germany ...