This starter implements a basic Express server with Prisma and TypeScript.
- Basic Node and TypeScript knowledge
- Node 16+
- Yarn 1.22.x
git clone https://github.com/beeman/node-express-prisma.git
cd node-express-prisma
yarn install
You need to create the .env
file and configure the settings. All the env vars are required.
Read the .env.example
file for configuration options.
// Or use your editor to copy the file...
cp .env.example .env
yarn prisma db push
yarn dev
curl -XPOST http://localhost:4000/register --header "Content-Type: application/json" --data '{ "email": "a@a.com", "password": "12345678" }'
curl -XPOST http://localhost:4000/login --header "Content-Type: application/json" --data '{ "email": "a@a.com", "password": "12345678" }'
curl -XGET http://localhost:4000/me --header "Content-Type: application/json" --header "Authorization: Bearer <token>"
You can also run this project using Docker.
cp .env.example .env
# Edit the .env file
docker compose up