V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
KasuganoSoras
V2EX  ›  分享创造

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

  •  3
     
  •   KasuganoSoras ·
    kasuganosoras · 2019-06-07 15:40:54 +08:00 · 8876 次点击
    这是一个创建于 1778 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

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

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

    项目持续更新,欢迎 Star。

    第 1 条附言  ·  2019-06-08 15:30:27 +08:00

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

    日常记录一些文章

    18 条回复    2019-12-11 11:04:33 +08:00
    Wyane
        1
    Wyane  
       2019-06-07 15:49:43 +08:00
    厉害了,还能这样玩,已 star
    KasuganoSoras
        2
    KasuganoSoras  
    OP
       2019-06-07 15:50:46 +08:00
    @Wyane #1 谢谢支持,这个 Workers 还有挺多好玩的,可以做成各种东西,有兴趣可以去看看他们的文档。
    SomeBottle
        3
    SomeBottle  
       2019-06-07 22:32:34 +08:00
    很有意思的小博客程序,正好我最近也在肝静态博客,前来围观
    mayne95
        4
    mayne95  
       2019-06-08 11:51:01 +08:00 via iPad
    上次 aftership 的分享会就讲的这个,还挺好玩的。不过当时看 cf 这个服务 5 刀起步,现在改了嘛?
    我现在用 netlify 的 functions 搞的,基本上提供免费额度 FaaS 的都可以这么玩。
    KasuganoSoras
        5
    KasuganoSoras  
    OP
       2019-06-08 15:29:14 +08:00   ❤️ 1
    @mayne95 #4 cloudflare 现在提供每天免费 10 万次请求,5 刀一个月就可以获得每天 1000 万次请求,不过我感觉个人用不到吧,一般自己博客一天最多也就几百次请求。
    mayne95
        6
    mayne95  
       2019-06-08 21:37:37 +08:00 via Android
    @KasuganoSoras 谢谢🎉我去研究下
    yfnok
        7
    yfnok  
       2019-06-09 09:07:17 +08:00
    这个有存储和流量限制嘛?
    EternalAC
        8
    EternalAC  
       2019-06-09 09:36:50 +08:00
    为什么我点 Save and deploy 保存不了啊?
    EternalAC
        9
    EternalAC  
       2019-06-09 10:00:21 +08:00
    @EternalAC 已经用 chrome 浏览器解决
    KasuganoSoras
        10
    KasuganoSoras  
    OP
       2019-06-09 13:08:04 +08:00
    @yfnok #7 不能储存文件,没有流量限制,它是按请求数量来限制的,每天免费 10 万次
    ihciah
        11
    ihciah  
       2019-06-09 14:23:22 +08:00
    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
        12
    EternalAC  
       2019-06-09 14:42:19 +08:00
    @KasuganoSoras 请教一下怎么实现 blog.natfrp.org?
    KasuganoSoras
        13
    KasuganoSoras  
    OP
       2019-06-09 15:46:09 +08:00
    @EternalAC #12 主要部分和我公开的源码是一样的,我只是根据个人需要加上了评论功能,然后把文章改为了倒序排列
    EternalAC
        14
    EternalAC  
       2019-06-09 16:08:03 +08:00
    @KasuganoSoras 我其实想表达的是,我想实现自己的域名访问,如何操作?
    我的 workers 的网站是 xxx.xxx.workers.dev
    现在我想让他可以通过 blog.timesl.tk 进行访问
    我尝试了一下使用 dnspod 的 cname,和直接解析 xxx.xxx.workers.dev ping 出来的 ip 都不行,
    想问一下你是怎么实现 blog.natfrp.org 访问的
    KasuganoSoras
        15
    KasuganoSoras  
    OP
       2019-06-09 17:49:17 +08:00
    witfun
        16
    witfun  
       2019-10-20 17:44:06 +08:00
    @KasuganoSoras 稍微挖一下😳
    域名解析那个 post 没了
    witfun
        17
    witfun  
       2019-10-20 18:34:53 +08:00
    @KasuganoSoras 解决了哈,感谢!
    获取到自己的****.workers.dev
    域名 Cname 到(****.workers.dev)
    然后去 Workers 点击 ADD route
    输入自定义域名,例如 gd.mjj.com/* 后面要加上 /*,下面的 workers 选择刚才的项目
    wwwzhujibcom
        18
    wwwzhujibcom  
       2019-12-11 11:04:33 +08:00
    这功能好像百度云加速也有
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1769 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:28 · PVG 00:28 · LAX 09:28 · JFK 12:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.