Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 1.53 KB

README.md

File metadata and controls

86 lines (66 loc) · 1.53 KB

This is a Next.js project bootstrapped with create-next-app.

Getting Started

Local Setup:

npm install
npm run dev

AWS

API

POST

curl --location --request POST 'http://localhost:3000/api/people/create' \
--header 'Content-Type: application/json' \
--data-raw '{
     "name": "Owen",
      "height": "76" ,
      "mass": 195, 
      "hair_color": "black", 
      "skin_color": "white", 
      "eye_color": "brown", 
      "gender": "male"
}'

GET

curl --location --request GET 'http://localhost:3000/api/people/'

Accessed at: http://localhost:3000/

SHOW

curl --location --request GET 'http://localhost:3000/api/people/<id>'

Accessed at: http://localhost:3000/person/<id>

PRISMA

Requirements

  • need a local postgres database
postgres-> CREATE DATABASE mydatabase;
  • create a .env file at root of project
DATABASE_URL="postgres://user@localhost/mydatabase"

Setting Up Prisma Connection

npx prisma db push

Migrate

npx prisma migrate --name name_of_migration

Seed the DB

npx prisma db seed

Prisma GUI

npx prisma studio

Resources