리액트 node 서버 연결(1)

안녕하세요·2023년 11월 9일

react x node 

목록 보기
1/18

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 수정

2개의 댓글

comment-user-thumbnail
2023년 11월 21일

조으네요

답글 달기
comment-user-thumbnail
2023년 11월 21일

조으네요

답글 달기