Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A demo using Nuxt, Cloudflare Pages, Cloudflare D1 database and Lucia for auth

NotificationsYou must be signed in to change notification settings

tlebeitsuk/nuxt-cloudflare-lucia

Repository files navigation

A demo usingNuxt, CloudflarePages +D1 database,Drizzle ORM andLucia auth.

Inspired byNuxt Todo List on the Edge.

Take a look atNuxtHub for a more complete solution.

Setup

Pages

A. Create a CF pages deployment linked to your GitHub repository.

B. UseWrangler:

pnpm build

Preview build (setup D1 first):

pnpm wrangler pages dev dist

Deploy build to CF:

pnpm wrangler pages publish dist

D1

A. Create a D1 database in CF.

In the CF Pages project settings -> Functions, add the binding between your D1 database and the DB variable.

B. Use Wrangler:

wrangler d1 create<DATABASE_NAME>

Bind Worker with D1 database:

----filename: wrangler.toml----name ="YOU PROJECT NAME"main ="./.output/server/index.mjs"[[d1_databases]]binding ="DB"# i.e. available in your Worker on env.DBdatabase_name ="<DATABASE_NAME>"database_id ="<unique-ID-for-your-database>"

To init local database and run server locally:

wrangler d1 execute<DATABASE_NAME> --local --file server/db/migrations/0000_cultured_fixer.sqlwrangler dev --local --persist

Deploy:

wrangler d1 execute<DATABASE_NAME> --file server/db/migrations/0000_cultured_fixer.sqlwrangler deploy

About

A demo using Nuxt, Cloudflare Pages, Cloudflare D1 database and Lucia for auth

Topics

Resources

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp