참고한 자료:
https://loy124.tistory.com/374
A ORM (Object Relational Mapper) to use MySQL. In contrast, mongoose
is a ODM (Object Document Mapper) to use MongoDB.
npm i sequelize mysql2 -S
npm i sequelize-cli -D
npx sequelize init
config/config.json
to my database informationnpx sequelize db:create
The files in the models
folder saves data in a model form.
The files in the migrations
folder is used to create and delete tables in the database.
npx sequelize model:generate --name User --attributes email:string,nickname:string,password:string
npx sequelize model:generate --name Goods --attributes name:string,thumbnailUrl:string,category:string,price:decimal
npx sequelize model:generate --name Cart --attributes userId:integer,goodsId:integer,quantity:integer
npx sequelize db:migrate
To create or migrate DB in the test environment (in Windows):
npx sequelize db:create --env test
npx sequelize db:migrate --env test
수정할거:
찾아볼거:
요청 제한: 1. 클라이언트 throttle, debounce, 2. 서버 rate limit을 통해 요청의 횟수 제한
status 500
참조 무결성 제약조건
Secret key는 AWS ASM으로 관리
물어볼거: