Edgio
预设:edgio
¥Preset: edgio
Edgio(以前称为 Layer0)扩展了传统 CDN 的功能,不仅可以托管你的静态内容,还可以为渐进式 Web 应用提供服务器端渲染,并在网络边缘缓存你的 API 和 HTML,从而为你的用户提供最快的浏览体验。
¥Edgio (formerly Layer0) extends the capabilities of a traditional CDN by not only hosting your static content, but also providing server-side rendering for progressive web applications as well as caching both your APIs and HTML at the network edge to provide your users with the fastest browsing experience.
如果这是你第一次部署到 Edgio,作为 deploy
命令一部分的交互式 CLI 将提示你使用浏览器进行身份验证。你也可以在部署之前使用 注册。
¥If this is your first time deploying to Edgio, the interactive CLI as part of the deploy
command will prompt to authenticate using your browser. You may also sign up prior to deployment.
安装 Eedgio CLI
¥Install the Eedgio CLI
npm i -g @edgio/cli
使用 Edgio 在本地测试生产构建
¥Testing production build locally with Edgio
你可以使用 Nitropack 在本地测试应用的开发体验:
¥You can use Nitropack to test your app's development experience locally:
NITRO_PRESET=edgio npx nitropack build
要在本地模拟你的应用在 Edgio 生产环境中的运行方式,请运行以下命令:
¥To simulate on local how your app would run in production with Edgio, run the following command:
edgio build && edgio run --production
从本地机器部署
¥Deploying from your local machine
在本地测试完应用后,你可以使用以下方式进行部署:
¥Once you have tested your application locally, you may deploy using:
edgio deploy
使用 CI/CD 部署
¥Deploying using CI/CD
如果你从非交互式环境部署,则需要先在 Edgio 开发者控制台 上创建一个账户,然后设置一个 部署令牌。创建部署令牌后,将其作为密钥保存到你的环境中。你可以通过运行以下命令开始部署:
¥If you are deploying from a non-interactive environment, you will need to create an account on Edgio Developer Console first and setup a deploy token. Once the deploy token is created, save it as a secret to your environment. You can start the deploy by running:
edgio deploy --token=XXX