2024.02.08(목)
탭 | 설명 |
---|---|
Components | component들의 props, state 등의 data를 확인할 수 있음 |
Profiler | 녹화되는 동안 render된 component들의 시간이 측정됨 |
npm run build
→ build 폴더가 생성됨npm install -g serve
npx serve -s build
app.js
에서 다음과 같이 static 파일들과 root 설정const path = require('path')
app.use(express.static(path.join(__dirname, 'coffee-store/build')))
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'coffee-store/build/index.html'));
});
useEffect
에서 AJAX(axios)로 api 요청보내서 data 받아오기