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

Tencent launches free 1-year GeoTrust DV SSL certificate

Address: https://console.qcloud.com/ssl It does n...

virpus 2015 latest offers

virpus, the service has been adjusted, based on X...

SolvingITLLC: $15/year/25GB SSD/100GB traffic/can bind 5 domain names

SolvingITLLC seems to be a newly established host...

IDCloudhost 1GB RAM 300Mbps Port Unlimited Traffic Singapore KVM VPS Review

Details : IDCloudhost: 23 yuan/month/1GB memory/2...

NodeQuery: Linux VPS Monitoring and Information

NodeQuery is a website that provides free VPS mon...

kimsufi Canada 9 Euro special price dedicated server ks3c review and purchase

The one below is the IE Ireland site, where the b...

USSHosting: $4.95/month/512MB memory/250GB space/1.5 TB traffic/1 IP/KVM

USSHosting, officially known as being founded in ...

$10/year/10G space/50G traffic virtual host—— HostWithLinux

HostWithLinux is a British hosting company, found...