In this tutorial, we'll create a simple Node.js and Express.js application and connect it to a PlanetScale database.
pscale auth login
pscale database create my-app
git clone https://github.com/planetscale/express-example.git
pscaleto create a connection to your database and start the app with the following command:
pscale connect your-db-name main --execute 'node app.js'
Congratulations! You successfully connected your Node.js and Express.js application to a PlanetScale database.
In this tutorial, we created a simple Node.js and Express.js application and connected it to PlanetScale's database and branching environments.
Now that you've successfully connected your Node.js app to PlanetScale, it's time to make schema changes to your tables and deploy your application! Learn more about how PlanetScale allows you to make non-blocking schema changes to your database tables without locking or causing downtime for production databases.