Open http://localhost:3000/api/docs to view it in the browser.
In the project directory, you can run:
To start the app in dev mode.
Open http://localhost:3000 to view it in the browser.
Build & runs production.
Run the test cases.
Run the test cases with code coverage.
Generate/regenerate the prisma client. This should be done after changing the prisma schema.
Migrate the prisma schema to the database and test database. This should only be run in the dev environment.
Clears the database and applies migrations. This should only be run in the dev environment.
Deploys the pending migrations to the databases.
To learn Fastify, check out the Fastify documentation.
Head to https://ngrok.com/download and download ngrok for your operating system.
Beware: If you are using WSL on Windows, you can just follow the linux guide and set it up in your WSL.
Now create a ngrok tunnel to your API:
ngrok http 3000
# Example using a static domain. This is highly recommended
ngrok http --domain=healthy-monkey-dancing.ngrok-free.app 3000
I recommend heading to https://dashboard.ngrok.com/cloud-edge/domains and creating a static domain, so you won't have to update your .env
file in the web application every time you create a new tunnel.
Set the BLOB_READ_WRITE_TOKEN
variable to the one from vercel.
Set the PUBLIC_API_URL
variable to the ngrok tunnel url. Example: PUBLIC_API_URL="https://healthy-monkey-dancing.ngrok-free.app/api/"
openssl genpkey -algorithm ed25519 -out private.pem
openssl pkey -in private.pem -pubout -out public.pem