← 返回
开发者工具 中文

Web Deploy

Build, preview, and deploy websites, web apps, and APIs using Vercel, Railway, GitHub Pages, or local Canvas environments.
使用 Vercel、Railway、GitHub Pages 或本地 Canvas 环境构建、预览和部署网站、Web 应用及 API。
cmanfre7 cmanfre7 来源
开发者工具 clawhub v1.0.0 1 版本 99949.6 Key: 无需
★ 1
Stars
📥 3,950
下载
💾 247
安装
1
版本
#latest

概述

web-deploy

Build and deploy websites, web apps, and APIs to production.

Local Preview Workflow

# Static site
npx http-server ./dist -p 8080 -c-1

# Next.js
npm run dev          # Development (hot reload)
npm run build && npm run start  # Production preview

# FastAPI
uvicorn app.main:app --reload --port 8000

# Vite-based
npm run dev          # Dev server
npm run build && npx serve dist  # Production preview

Deployment Targets

Vercel (Frontend / Next.js / Static)

# First time setup
npx vercel link

# Preview deployment
npx vercel

# Production deployment
npx vercel --prod

# Environment variables
npx vercel env add SECRET_KEY

Best for: Next.js apps, React SPAs, static sites, serverless functions.

Config: vercel.json (usually not needed for Next.js)

{
  "buildCommand": "npm run build",
  "outputDirectory": "dist",
  "framework": "nextjs"
}

Railway (Backend / APIs / Databases)

# First time setup
railway login
railway init

# Deploy
railway up

# Add database
railway add --plugin postgresql

# Environment variables
railway variables set SECRET_KEY=value

# View logs
railway logs

Best for: Backend APIs, databases, long-running processes, Docker containers.

GitHub Pages (Static Sites)

# Using gh-pages package
npm install -D gh-pages
# Add to package.json scripts: "deploy": "gh-pages -d dist"
npm run build && npm run deploy

Best for: Documentation, simple static sites, project pages.

Canvas (Clawdbot Workspace)

Deploy to ~/clawd/canvas/ for local serving through the clawdbot gateway.

cp -r ./dist/* ~/clawd/canvas/my-project/

Pre-Deploy Checklist

  • [ ] Build succeeds locally (npm run build / python -m build)
  • [ ] No TypeScript/lint errors
  • [ ] Tests pass
  • [ ] Environment variables set on target platform
  • [ ] .env / secrets NOT in git
  • [ ] robots.txt and sitemap.xml if public site
  • [ ] Favicon and meta tags set
  • [ ] HTTPS configured (automatic on Vercel/Railway)
  • [ ] Error pages (404, 500) configured
  • [ ] Performance: images optimized, code split, no huge bundles

Rollback

# Vercel — redeploy previous
npx vercel rollback

# Railway — redeploy previous
railway rollback

# Git-based — revert and push
git revert HEAD && git push

Domain Setup

# Vercel
npx vercel domains add mydomain.com

# DNS: Point CNAME to cname.vercel-dns.com
# Or A record to 76.76.21.21

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 11:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,785
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 194 📥 67,416
design-media

Design Assets

cmanfre7
使用 macOS 工具、ImageMagick、SVG 与 AI 图像生成来创建和编辑图标、favicon、图片及配色方案。
★ 2 📥 3,795