Install the dependencies.
Terminalnpm installCreate the local database. It applies every migration to a local copy of D1.
Terminalnpm run db:migrate:localAdd local secrets. Create
.dev.varsnext topackage.json..dev.varsEDIT_PASSCODE=choose-a-long-passcodeStart the app and open http://localhost:3000.
Terminalnpm run dev
Checks before a change
Terminal
npm run typecheck
npm run lint
npm run buildRun and validate
Terminal
npm install
cp .dev.vars.example .dev.vars # set EDIT_PASSCODE
npm run db:migrate:local
npm run dev
npm run typecheck
npm run lint
npx opennextjs-cloudflare build
npx wrangler deploy --dry-runTo try the email handler locally, run npm run preview and post a raw message:
Terminal
curl -X POST 'http://localhost:8787/cdn-cgi/handler/email?from=sender@example.org&to=admin@appneural.com' \
--data-binary @message.eml