Deploy a Node Express application using Prisma application on Koyeb
Learn more about Koyeb
·
Explore the documentation
·
Discover our tutorials
Koyeb is a developer-friendly serverless platform to deploy apps globally. No-ops, servers, or infrastructure management. This repository contains a Node Express application using Prisma you can deploy on the Koyeb serverless platform for testing.
This example application is designed to show how a Node Express application using Prisma can be deployed on Koyeb.
Follow the steps below to deploy and run the Node Express application using Prisma on your Koyeb account.
You need a Koyeb account to successfully deploy and run this application. If you don't already have an account, you can sign-up for free here.
Run the following command to create the database. This also creates the Planet table that is defined in prisma/schema.prisma
:
DATABASE_URL="postgres://..." npx prisma migrate dev --name init
DATABASE_URL="postgres://..." npx prisma db seed
The fastest way to deploy the Node Express application using Prisma is to click the Deploy to Koyeb button below.
Clicking on this button brings you to the Koyeb App creation page with everything pre-set to launch this application. Modify the value of the DATABASE_URL
environment variable to your database connection string before deploying.
To modify this application example, you will need to fork this repository. Checkout the fork and deploy instructions.
If you want to customize and enhance this application, you need to fork this repository.
If you used the Deploy to Koyeb button, you can simply link your service to your forked repository to be able to push changes. Alternatively, you can manually create the application as described below.
On the Koyeb Control Panel, on the Overview tab, click the Create Web Service button to begin.
- Select
GitHub
as the deployment method. - In the repositories list, select the repository you just forked.
- Expand the Builder section. Click the override toggle associated with the Build command field and enter the command needed to initialize your database backend (
npm run postgres:init
ornpm run mysql:init
ornpm run mongodb:init
ornpm run cockroachdb:init
) in the field. - Expand the Environment variables section. Click Add variable and set
DATABASE_URL
to the connection string for your database. - Choose a name for your App, i.e
express-prisma-on-koyeb
, and click Deploy.
You land on the deployment page where you can follow the build of your Node Express application using Prisma. Once the build is completed, your application is being deployed and you will be able to access it via <YOUR_APP_NAME>-<YOUR_ORG_NAME>.koyeb.app
.
If you have any questions, ideas or suggestions regarding this application sample, feel free to open an issue or fork this repository and open a pull request.