Skip to content

Files

Latest commit

AndriiShermanklotztechNicholas LyAlexBlokhSukairo-02
Nov 14, 2024
2677718 · Nov 14, 2024

History

History

neon-cloudflare

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 3, 2023
Mar 18, 2024
Feb 3, 2023
Feb 3, 2023
Feb 3, 2023
Mar 26, 2023
Mar 18, 2024
Nov 14, 2024
Feb 3, 2023
Feb 3, 2023

Here's the original launch blog post and official CF demo repo

First let's setup your Cloudflare Worker project based on official docs

## wrangler.toml

name = "neon-cf-demo"
main = "src/index.ts"
compatibility_date = "2022-12-09"
usage_model = "unbound"
node_compat = true

Setup Neon Serverless database - official docs, grab database url with project tag, put them in .dev.vars. You will need project name for postgres.js driver to run migrations - read here

DATABASE_URL=postgres://user:password@localhost:5432/dbname
PROJECT_NAME=shiny-fire-338756

now we can run the project!

npm i

## run locally
npm start

## generate SQL migrations for schema.ts
npm run generate

## apply migrations to remote database
npm run migrate

That's it! Subscribe to our Twitter and join our comminity on Discord 🚀