跳转到内容
搜索文档

仪表板

最后更新 查看 MarkdownAgent 设置

按照本指南,使用 Cloudflare 仪表板创建 Workers 应用。

前置条件

创建 Cloudflare 账户(若尚未创建)。

设置

要开始使用新的 Workers 应用:

  1. 在 Cloudflare 仪表板中,进入 Workers & Pages 页面。

    Go to Workers & Pages ↗
  2. 选择 Create application(创建应用程序)。在此你可以:

    • 从生产就绪模板库中选择
    • 导入你账户中已有的 Git 仓库
    • 让 Cloudflare 克隆并引导包含 Workers 应用的公开仓库。
  3. 连接你选择的 Git 提供商 后,配置项目并选择 Deploy(部署)

  4. Cloudflare 将启动新的构建和部署。部署完成后,可在提供的 workers.dev 子域名上预览你的 Worker。

继续开发

在仪表板中创建的应用已配置 Git,便于你快速启动开发工作流。要在仓库中继续开发,可运行:

# clone your repository locally
git clone <git repo URL>

# make sure you are in the root directory
cd <directory>

现在,你可以通过在本地开发环境中运行 Wrangler 来预览和测试更改。准备部署时,可运行:

# adds the files to git tracking
git add .

# commits the changes
git commit -m "your message"

# push the changes to your Git provider
git push origin main

如需了解更多:

这篇文档对您有帮助吗?