728x90

Json / Axios

Npx create-react-app 프로젝트명 < 프로젝트생성

 

Yarn install.  <yarn 설치

 

yarn add react redux-react. < redux설치

 

yarn add react-redux @reduxjs/toolkit < redux tool kit설치

 

yarn add json-server < json 설치

 

yarn json-server --watch db.json --port 3001 < json서버 실행

 

Yarn start  < react 실행 (별도의 터미널에서 실행할것)

 

 

 

Db.json 에들어온 내용을 확인하려면 

일단 json 서버를 실행시켜주고 

Localhost:3001/ “todos” 또는 배열의 이름을 넣으면 알수있다

get요청이 정상적으로 작동이되면 터미널에  Get요청이되었다고 

메시지가 남는다

 

 

yarn add axios < Axios설치

728x90

+ Recent posts