
1. 리액트 환경 구성
yarn create react-app front
(front폴더 내에서)
yarn add react-router-dom
yarn add react-bootstrap bootstrap
yarn add axios
yarn add react-icons
2. Node.js 프로젝트 생성
mkdir server
(server 폴더 내에서 )
npm init --yes ( 프로젝트 초기화)
npm i express
npm i mysql2
npm i cors
npm i nodemon --save-dev
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type" : "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon server"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"express": "^4.18.2",
"mysql2": "^3.6.3"
},
"devDependencies": {
"nodemon": "^3.0.1"
}
}
간단히 package.json 수정
조으네요