爱意满满的作品展示区。
KasuganoSoras

利用 CloudFlare workers + Github 实现简易动态博客

  •  3
     
  •   KasuganoSoras ·
    kasuganosoras · Jun 7, 2019 · 10686 views
    This topic created in 2713 days ago, the information mentioned may be changed or developed.

    先上链接:https://blue-sun-6fe4.zerodream.workers.dev/

    Cloudflare 有个叫 Workers 的东西,是用来进行边缘计算之类的,它支持 JavaScript 编写程序。

    然后就有了这个玩意……我把它做成了博客

    项目地址: https://github.com/kasuganosoras/cloudflare-worker-blog

    有兴趣可以玩玩,Cloudflare 提供每天 10 万次的免费请求额度,搭建一个小博客玩玩足够了

    项目持续更新,欢迎 Star。

    Supplement 1  ·  Jun 8, 2019

    做了一个正式一点的博客:https://blog.natfrp.org/

    日常记录一些文章

    18 replies  •  2019-12-11 11:04:33 +08:00
    Wyane
    Wyane
    Jun 7, 2019
    1
    厉害了,还能这样玩,已 star
    KasuganoSoras
    KasuganoSoras
    OP
    Jun 7, 2019
    2
    @Wyane #1 谢谢支持,这个 Workers 还有挺多好玩的,可以做成各种东西,有兴趣可以去看看他们的文档。
    SomeBottle
    SomeBottle
    Jun 7, 2019
    3
    很有意思的小博客程序,正好我最近也在肝静态博客,前来围观
    mayne95
    mayne95
    Jun 8, 2019 via iPad
    4
    上次 aftership 的分享会就讲的这个,还挺好玩的。不过当时看 cf 这个服务 5 刀起步,现在改了嘛?
    我现在用 netlify 的 functions 搞的,基本上提供免费额度 FaaS 的都可以这么玩。
    KasuganoSoras
    KasuganoSoras
    OP
    Jun 8, 2019❤️1
    5
    @mayne95 #4 cloudflare 现在提供每天免费 10 万次请求,5 刀一个月就可以获得每天 1000 万次请求,不过我感觉个人用不到吧,一般自己博客一天最多也就几百次请求。
    mayne95
    mayne95
    Jun 8, 2019 via Android
    6
    @KasuganoSoras 谢谢🎉我去研究下
    yfnok
    yfnok
    Jun 9, 2019
    7
    这个有存储和流量限制嘛?
    EternalAC
    EternalAC
    Jun 9, 2019
    8
    为什么我点 Save and deploy 保存不了啊?
    EternalAC
    EternalAC
    Jun 9, 2019
    9
    @EternalAC 已经用 chrome 浏览器解决
    KasuganoSoras
    KasuganoSoras
    OP
    Jun 9, 2019
    10
    @yfnok #7 不能储存文件,没有流量限制,它是按请求数量来限制的,每天免费 10 万次
    ihciah
    ihciah
    Jun 9, 2019
    11
    Accounts using the Workers free tier are limited to a maximum of 100,000 requests per day, with a burst rate limit of 1000 requests per 10 minutes. This limit applies at the account level, meaning that requests on your workers.dev subdomain count toward the same limit as your zoned domains. Visitors who run into the rate limit will be served a Cloudflare 1015 error page, however if you are calling your script programmatically, you can detect the rate limit page and handle it yourself by looking for HTTP status code 429. Upgrading to a paid plan will automatically lift this limit.

    感觉自己用用可以,但是做公开服务很容易被搞啊==隔 10 分钟来 1000 次请求就炸了
    EternalAC
    EternalAC
    Jun 9, 2019
    12
    @KasuganoSoras 请教一下怎么实现 blog.natfrp.org?
    KasuganoSoras
    KasuganoSoras
    OP
    Jun 9, 2019
    13
    @EternalAC #12 主要部分和我公开的源码是一样的,我只是根据个人需要加上了评论功能,然后把文章改为了倒序排列
    EternalAC
    EternalAC
    Jun 9, 2019
    14
    @KasuganoSoras 我其实想表达的是,我想实现自己的域名访问,如何操作?
    我的 workers 的网站是 xxx.xxx.workers.dev
    现在我想让他可以通过 blog.timesl.tk 进行访问
    我尝试了一下使用 dnspod 的 cname,和直接解析 xxx.xxx.workers.dev ping 出来的 ip 都不行,
    想问一下你是怎么实现 blog.natfrp.org 访问的
    witfun
    witfun
    Oct 20, 2019
    16
    @KasuganoSoras 稍微挖一下😳
    域名解析那个 post 没了
    witfun
    witfun
    Oct 20, 2019
    17
    @KasuganoSoras 解决了哈,感谢!
    获取到自己的****.workers.dev
    域名 Cname 到(****.workers.dev)
    然后去 Workers 点击 ADD route
    输入自定义域名,例如 gd.mjj.com/* 后面要加上 /*,下面的 workers 选择刚才的项目
    wwwzhujibcom
    wwwzhujibcom
    Dec 11, 2019
    18
    这功能好像百度云加速也有
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3567 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 04:05 · PVG 12:05 · LAX 20:05 · JFK 23:05
    ♥ Do have faith in what you're doing.