์ด ํ๋ก์ ํธ๋ ๊ฐ์ธ์ ์ผ์ ์ ํตํฉํด ๋ชจ์์ ์ผ์ ์ ์ฝ๊ฒ ์ ํ ์ ์๊ฒ ๋์์ฃผ๋ ์น ์๋น์ค์ ๋๋ค. ๊ฐ์ ๊ฐ์ธ์ ์ผ์ ์ '๊ฐ์ธ ์ผ์ 'ํ์ด์ง์์ ๋ฑ๋กํ๊ณ '์ฌ์ ๋ชจ์'์ ์์ฑํ์ฌ ์น๊ตฌ๋ฅผ ์ด๋ํ ๋ค ๊ฐ์์ ์ผ์ ์ ๋น๊ตํด ์ต์ ์ ๋ชจ์ ์ผ์ ์ ์ ํด๋ณด์ธ์!
- database
์์ฑ๊ธฐ๋ณธ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ด๋ฆฌ ์์คํ (DBMS)์ MySQL/MariaDB์ ๋๋ค. MySQL ๋๋ MariaDB๋ฅผ ์ค์นํ๊ณ ์ํ๋ ์ด๋ฆ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ฅผ ์์ฑํ์ธ์. ๋ค๋ฅธ DBMS๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด src/config ๋๋ ํ ๋ฆฌ์ ์๋ dataSource.ts ํ์ผ์ ๋ณ๊ฒฝํ ์ ์์ต๋๋ค.
- .env.dev ํ์ผ ์์ฑ
CLIENT_URL=http://localhost:4000
PORT=3000 # port on which the server will listen
DB_HOST=localhost # host(ip) of the database
DB_PORT=3306 # port of the database
DB_USER=root # username of the database
DB_PASSWORD=pwd # password of the database
DB_NAME=example # name of the database, which you created in the previous step
๋ฅผ ์์ฑํ์๋ฉด ๋ฉ๋๋ค. ๊ทธ ํ
npm install
npm run dev๋ฅผ ํ์๋ฉด http://localhost:3000์์ ์คํ๋ฉ๋๋ค.