cloudflare_将静态NuxtJS网站部署到Cloudflare Workers

cloudflare

Recently Cloudflare announced Workers support for static sites. This opens up a whole new era of static website deployment. Cloudflare Workers is a Serverless platform that allows us to write and run JavaScript and WebAssembly on their Edge network. Now with the help of Cloudflare KV and Workers, we can deploy static websites built or generated with Nuxt, Hugo, Gatsby or Jekyll directly to their network.

最近,Cloudflare宣布了Workers支持静态站点。 这开辟了静态网站部署的全新时代。 Cloudflare Workers是一个无服务器平台,允许我们在其Edge网络上编写和运行JavaScript和WebAssembly。 现在,借助Cloudflare KV和Workers,我们可以将使用Nuxt,Hugo,Gatsby或Jekyll构建或生成的静态网站直接部署到他们的网络。

Workers Sites are very appealing due to

由于以下原因,工人站点非常吸引人

  • Low Cost

    低成本
  • Very Fast

    非常快
  • Secure

    安全
  • Easy to Scale

    易于扩展

I am using Cloudflare Workers since last 1 year for different purposes. I am mostly working with VueJS for frontend development, and prefer NuxtJS for complex websites that requires support for routing, store management and many more.

从去年开始,我就将Cloudflare Workers用于不同的目的。 我主要使用VueJS进行前端开发,而更喜欢NuxtJS用于需要路由,商店管理等更多支持的复杂网站。

When they announced support for static sites, first thing on my mind was that what if we can deploy NuxtJS site to Workers? This will be game changing, as I won't have to switch between multiple providers like Netlify, S3 static sites and others. Out of curiosity, I quickly boot-up a small NuxtJS project and deployed it. Here's the screenshot of full-fledged NuxtJS site deployed on Cloudflare Workers.

当他们宣布支持静态网站时,我首先想到的是,如果我们可以将NuxtJS网站部署到Workers,该怎么办? 这将改变游戏规则,因为我不必在Netlify,S3静态站点等其他提供商之间切换。 出于好奇,我Swift启动了一个小的NuxtJS项目并进行了部署。 这是部署在Cloudflare Workers上的完整NuxtJS网站的屏幕快照。

You can find a full source of the project available here on GitHub.

你可以找到可用的项目的全部源代码这里 GitHub上。

先决条件 ( Prerequisites )

In this tutorial, you'll learn how to deploy your NuxtJS site to the Cloudflare Workers. First we'll create a new NuxtJS project and then we'll deploy it.

在本教程中,您将学习如何将NuxtJS站点部署到Cloudflare Workers。 首先,我们将创建一个新的NuxtJS项目,然后将其部署。

To publish your site to Cloudflare Workers, you'll need:

要将您的网站发布给Cloudflare Workers,您需要:

  • A Cloudflare account with Workers Unlimited plan (it's just $5/m and includes first 10M requests)

    带有Workers Unlimited计划的Cloudflare帐户(每月$ 5,包括前1000万个请求)
  • Latest version of Wrangler CLI

    最新版本的Wrangler CLI
  • Basic knowledge of VueJS/NuxtJS

    VueJS / NuxtJS的基础知识

Let's install Wrangler CLI (skip if already installed)

让我们安装Wrangler CLI(如果已安装,请跳过)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值