mw10013 / remix-cf-20240202

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remix-Cf

Deployment

  • https://remix-cf-anq.pages.dev

  • Deployed to Cloudflare Pages.

  • Use Deploy a Remix Site Guide.

  • Environment Variable (for Production and Preview): .dev.vars.example

  • Redox

    • Developer | API Keys | Create API Key

      • Name: mw
      • Key pairs | Generate your keys | Generate New API Keys
      • Download json public and private keys (JWK), postman env
    • Developer | Endpoints | Create Endpoint

      • Name: local
      • Redox API Endpoint: [cloudflare tunnel to localhost from tunnel script in package.json]
      • Verification Token: [REDOX_ENDPOINT_VERIFICATION_TOKEN env var]
      • Verification Method: POST
    • D1

D1

  • May need to create wrangler.toml manually and set d1_database settings.
pnpm wrangler d1 execute rcf_db --file=./d1/schema.sql --local
pnpm wrangler d1 execute rcf_db --command='select * from users' --local
pnpm wrangler d1 execute rcf_db --command='pragma table_list' --local
pnpm wrangler d1 execute rcf_db --command='pragma table_info(users)' --local
pnpm wrangler d1 execute rcf_db --command='pragma table_info(d1_migrations)' --local
pnpm wrangler d1 execute rcf_db --command='select name, sql from sqlite_master' --local
pnpm wrangler d1 execute rcf_db --command='select * from d1_migrations' --local
pnpm wrangler d1 migrations list rcf_db --local
pnpm wrangler d1 migrations apply rcf_db --local

Scripts

pnpm script scripts/chat.ts
pnpm tsx --env-file=.dev.vars scripts/chat.ts

Drizzle

Welcome to Remix!

Development

You will be utilizing Wrangler for local development to emulate the Cloudflare runtime. This is already wired up in your package.json as the dev script:

# start the remix dev server and wrangler
npm run dev

Open up http://127.0.0.1:8788 and you should be ready to go!

Deployment

Cloudflare Pages are currently only deployable through their Git provider integrations.

If you don't already have an account, then create a Cloudflare account here and after verifying your email address with Cloudflare, go to your dashboard and follow the Cloudflare Pages deployment guide.

Configure the "Build command" should be set to npm run build, and the "Build output directory" should be set to public.

About


Languages

Language:TypeScript 94.0%Language:JavaScript 5.9%Language:CSS 0.1%