Skip to content

beeman/node-express-prisma

Repository files navigation

node-express-prisma

This starter implements a basic Express server with Prisma and TypeScript.

Requirements

  • Basic Node and TypeScript knowledge
  • Node 16+
  • Yarn 1.22.x

Running this project

1. Clone the repo

git clone https://github.com/beeman/node-express-prisma.git
cd node-express-prisma

2. Install the dependencies

yarn install

3. Configure your environment

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

4. Create the database

yarn prisma db push

5. Run the server

yarn dev

6. Call server endpoints

Register a new user

curl -XPOST http:https://localhost:4000/register --header "Content-Type: application/json" --data '{ "email": "[email protected]", "password": "12345678" }'

Login

curl -XPOST http:https://localhost:4000/login --header "Content-Type: application/json" --data '{ "email": "[email protected]", "password": "12345678" }'

Get user info

curl -XGET http:https://localhost:4000/me --header "Content-Type: application/json" --header "Authorization: Bearer <token>"

Docker

You can also run this project using Docker.

cp .env.example .env
# Edit the .env file
docker compose up

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages