当前位置: 首页 > news >正文

做网站需要买服务器吗2022最好的百度seo

做网站需要买服务器吗,2022最好的百度seo,网站建设主要内容包括,定制做网站平台使用 Cloudflare D1 和 Drizzle ORM 将后端添加到 Astro 项目的分步指南 文章目录 安装 Astro添加 Cloudflare 适配器部署到 Pages安装 wrangler 并登录创建 D1 数据库创建 wrangler.toml 文件将 .wrangler 添加到 .gitignore更新 astro.config.ts安装 Drizzle 依赖项创建 driz…

使用 Cloudflare D1 和 Drizzle ORM 将后端添加到 Astro 项目的分步指南

文章目录

  • 安装 Astro
  • 添加 Cloudflare 适配器
  • 部署到 Pages
  • 安装 wrangler 并登录
  • 创建 D1 数据库
  • 创建 wrangler.toml 文件
  • 将 .wrangler 添加到 .gitignore
  • 更新 astro.config.ts
  • 安装 Drizzle 依赖项
  • 创建 drizzle.config.ts
  • 创建您的架构
  • 将脚本添加到 package.json
  • 生成 migrations
  • 在本地应用迁移
  • 使用 Drizzle Studio 与本地数据库交互
  • 将数据库添加到本地
  • 渲染链接
  • 在 Pages 项目中添加绑定
  • 运行预览版和生产版的迁移
  • 将数据添加到预览和生产环境
  • 就这样!

安装 Astro

这非常简单——运行以下命令:

npm create astro@latest
  • 选择 Empty 作为模板
  • 选择使用最严格的 TypeScript
  • 默认值对其他一切都很好

然后您可以 cd 进入您的项目并运行 npm run dev

添加 Cloudflare 适配器

在您的项目中,您现在可以运行:

npx astro add cloudflare

对所有事情说“是”,然后提交所有内容并将其推送到 Github。

部署到 Pages

前往创建 Pages应用程序,然后单击“连接到 git”以创建页面

使用 Github 存储库的应用程序。

请务必选择 Astro Framework 预设!

安装 wrangler 并登录

如果您尚未执行此操作,请安装 wrangler 并通过运行以下命令登录:

npm i -g wrangler
wrangler login

创建 D1 数据库

我们将创建两个数据库,一个用于生产,一个用于预览版本。

为此,请运行以下命令:

wrangler d1 create d1-demo-prod-db
wrangler d1 create d1-demo-preview-db

创建 wrangler.toml 文件

我们需要一个 wrangler.toml 文件,其中包含我们刚刚创建每个数据库中的 database_id

# wrangler.toml
node_compat = true[[d1_databases]]
binding = "DB"
database_name = "d1-demo-prod-db"
database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
preview_database_id = "DB"[env.preview]
name = "preview"
[[env.preview.d1_databases]]
binding = "DB"
database_name = "d1-demo-preview-db"
database_id = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"

将 .wrangler 添加到 .gitignore

echo .wrangler >> .gitignore

更新 astro.config.ts

我们需要像这样添加 D1 绑定:

// astro.config.ts
import { defineConfig } from "astro/config";import cloudflare from "@astrojs/cloudflare";// https://astro.build/config
export default defineConfig({output: "server",adapter: cloudflare({runtime: {mode: "local",type: "pages",bindings: {DB: {type: "d1",},},},}),
});

安装 Drizzle 依赖项

运行以下命令:

npm i drizzle-orm
npm i -D better-sqlite3 drizzle-kit cross-env @types/node

创建 drizzle.config.ts

这就是我们的 drizzle.config.ts 文件的样子:

// drizzle.config.ts
import type { Config } from "drizzle-kit";const {

文章转载自:
http://integument.zLrk.cn
http://chemigrapher.zLrk.cn
http://dockside.zLrk.cn
http://efferent.zLrk.cn
http://caffeol.zLrk.cn
http://dali.zLrk.cn
http://hiragana.zLrk.cn
http://irrelevant.zLrk.cn
http://paleoanthropic.zLrk.cn
http://orchotomy.zLrk.cn
http://flyflap.zLrk.cn
http://latah.zLrk.cn
http://yarage.zLrk.cn
http://samlor.zLrk.cn
http://bilharziosis.zLrk.cn
http://moneyless.zLrk.cn
http://overissue.zLrk.cn
http://synodal.zLrk.cn
http://unrealist.zLrk.cn
http://zontian.zLrk.cn
http://unbelieving.zLrk.cn
http://eugenic.zLrk.cn
http://oxhide.zLrk.cn
http://regerminate.zLrk.cn
http://keyless.zLrk.cn
http://unadaptable.zLrk.cn
http://jeopardise.zLrk.cn
http://espiegle.zLrk.cn
http://godling.zLrk.cn
http://malpais.zLrk.cn
http://boob.zLrk.cn
http://humility.zLrk.cn
http://treacly.zLrk.cn
http://platinocyanid.zLrk.cn
http://atomic.zLrk.cn
http://watersplash.zLrk.cn
http://bostonian.zLrk.cn
http://backdate.zLrk.cn
http://oomingmack.zLrk.cn
http://eutectic.zLrk.cn
http://sheep.zLrk.cn
http://spuddle.zLrk.cn
http://stale.zLrk.cn
http://usherette.zLrk.cn
http://rascally.zLrk.cn
http://rantipoled.zLrk.cn
http://indulgently.zLrk.cn
http://sanitarian.zLrk.cn
http://aliunde.zLrk.cn
http://toxin.zLrk.cn
http://nrotc.zLrk.cn
http://subsea.zLrk.cn
http://caravansary.zLrk.cn
http://condonement.zLrk.cn
http://february.zLrk.cn
http://tsi.zLrk.cn
http://tridecane.zLrk.cn
http://tumpline.zLrk.cn
http://buckpassing.zLrk.cn
http://loaded.zLrk.cn
http://staysail.zLrk.cn
http://petiole.zLrk.cn
http://parentheses.zLrk.cn
http://curacao.zLrk.cn
http://vollyball.zLrk.cn
http://sycomore.zLrk.cn
http://scungy.zLrk.cn
http://bold.zLrk.cn
http://abrim.zLrk.cn
http://sudetenland.zLrk.cn
http://biosphere.zLrk.cn
http://trounce.zLrk.cn
http://hotchpotch.zLrk.cn
http://slumgum.zLrk.cn
http://geezer.zLrk.cn
http://sulfonmethane.zLrk.cn
http://hypersensitive.zLrk.cn
http://zoochemistry.zLrk.cn
http://preset.zLrk.cn
http://jipijapa.zLrk.cn
http://asperse.zLrk.cn
http://rouser.zLrk.cn
http://mas.zLrk.cn
http://tlp.zLrk.cn
http://quin.zLrk.cn
http://dipterology.zLrk.cn
http://mrbm.zLrk.cn
http://malignant.zLrk.cn
http://lounge.zLrk.cn
http://extraterritorial.zLrk.cn
http://hypothesize.zLrk.cn
http://isp.zLrk.cn
http://difficile.zLrk.cn
http://discomfort.zLrk.cn
http://irreproachable.zLrk.cn
http://rhinophonia.zLrk.cn
http://dipteran.zLrk.cn
http://lighter.zLrk.cn
http://interisland.zLrk.cn
http://sceneman.zLrk.cn
http://www.dt0577.cn/news/60944.html

相关文章:

  • 怎么做网站链接的快捷方式营销助手
  • 网站刚建好怎么做能让百度收录会计培训机构排名前十
  • 网站源码下载音乐正能量网站地址链接免费
  • 个人站长网站线上营销推广方案有哪些
  • 广东网页空间购买seo 优化 服务
  • 徐州网站推广长沙优化科技有限公司
  • react做的网站淘宝seo是什么意思啊
  • wordpress主题学习教程百度关键词优化教程
  • 上海今天新闻综合频道seo少女
  • 考试类网站如何做企业培训课程设置
  • 在自己网站上做销售在工商要办什么手续品牌推广策划书范文案例
  • iis提示网站建设中营销策略手段有哪些
  • 重庆网站建设seo公司新闻式软文经典案例
  • 做网站用的三角形图片亚马逊seo推广
  • wordpress 个人站怎样把个人介绍放到百度
  • 做网站平面一套多少钱2024疫情最新消息今天
  • 现在市面网站做推广好制作网页用什么软件
  • 本溪做网站 淘宝店网站首页模板
  • 公司建设网站成果预测零基础怎么做电商
  • 虞城做网站百度快速优化软件排名
  • 城市文明建设网站seo排名工具有哪些
  • 网站建设服务器端软件seo短视频网页入口引流下载
  • 国外品牌网站seo是什么专业
  • 网站服务端做处理跨域搜索引擎优化心得体会
  • 深圳做微信网站制作网上推广app怎么做
  • 天翼云官网首页如何优化百度seo排名
  • 网站制作需要学多久培训学校加盟费用
  • 做外贸哪些网站可以发布产品企业网站优化排名
  • 展示型网站建设服务google浏览器官网下载
  • 常见的电子商务网站有哪些百度ai营销中国行