1. Prisma + PostgreSQL + AWS RDS
npm i prisma --save-dev
npm i @prisma/client
npx prisma init
AWS ๋ฑ DB ์์ฑ ํ ์ฐ๊ฒฐํ๊ธฐ
AWS์ RDS(Relational Database Service)
.env
ํ์ผ ์์ฑDATABASE_URL=postgresql://id:pw@์๋ํฌ์ธํธ:port๋ฒํธ/kall?schema=public
5432
์ฌ์ฉ Contact
๋ผ๋ Table์ด ์์ฑ ๋จnpx prisma format
(1) ๋ง์ด๊ทธ๋ ์ด์
์์ฑ
npx prisma migrate dev โname <migration-name>
(2) ์ ์ฉ
npx prisma migrate dev
npx prisma migrate dev โname contact
npx prisma generate
2. Next.js API routes
src - app - api
ํด๋์ api ํ์ผ ์์ฑ
client์์ api ์ ๊ทผํ๊ธฐ