This is the code repository for the guide on how to deploy a Netlify functions application with Neon. Follow the guide to set up your Neon project and configure the Netlify CLI.
Run the command below to copy the .env.example
file, to the neon-netlify-example
directory, and rename it to .env
.
cp .env.example neon-netlify-example/.env
Store your Neon credentials in this .env
file.
DATABASE_URL="postgresql://neondb_owner:...@ep-...us-east-1.aws.neon.tech/neondb?sslmode=require"
user
is the database user.password
is the database user’s password.endpoint_hostname
is the host with neon.tech as the TLD.dbname
is the name of the database. “neondb” is the default database created with each Neon project.?sslmode=require
an optional query parameter that enforces the SSL mode while connecting to the Postgres instance for better security.
Important: To ensure the security of your data, never expose your Neon credentials to the browser.
Change to the neon-netlify-example
directory and run the command below to install project dependencies:
cd neon-netlify-example && npm install
Run the command below to initialize a new Netlify site:
netlify sites:create
Test running the application locally by running the command below:
netlify dev
Follow the guide for further instructions on how to deploy the functions to the Netlify platform.