๋ฐ์ํ
// 1. [myServer]ํด๋ ์์ฑ
// 2. VSConde๋ฅผ ์ด์ด๋ง๋ค์ด๋ ์๋ฃ๊ฐ ์๋ค๋ฉด, git clone [๋ฆฌํฌ์งํ ๋ฆฌ] ํด์ค๋๋ค.
// 3. ํฐ๋ฏธ๋์์ npm ์ ์ด์ฉํด json-server ์ ์ญ ์ค์น๋ฅผ ํด์ค๋๋ค
npm i -g json-server
// 4. ์ฑ ๋ด์ data ํด๋๋ก ์ด๋ํฉ๋๋ค.
cd data
// 5. ์ ์ ๊ฒฝ์ฐ๋ npx๋ฅผ ์
๋ ฅํด์ฃผ์ง ์์ผ๋ฉด ์ค์น๊ฐ ๋์ง ์์์ด์ ใ
ใ
npx json-server --watch data.json --port 30001
// localhost:3001 ์ ์ฃผ์์ฐฝ์ ์
๋ ฅํด์ server๊ฐ ์ ์ด๋ ธ๋์ง ํ์ธํด ๋ด
๋๋ค.
์ ๋ ์ฒ์์ ์ค์นํ๋ฉด์ ๋ง๋ฌ๋ ์ค๋ฅ๋ค์ด ์ด ๋๊ฐ์ง๋
ํด๋ ์์ ๋๊ฐ์ ๋ด์ฉ์ ํด๋๊ฐ ์ฐ์๋์ด ์์ฑ๋๋ ์ค์๋ฅผ ์ ์ง๋ ๋๋ฐ์!
๊ทธ๋ฌ๋ฉด ์๋ฉ๋๋ค!
// ๋ง์ฃผํ๋ ์ค๋ฅ๋ค
zsh: command not found: json-server
json-server: command not found error
[๊ทธ๋ฆผ] ์๋ชป๋ ์
'Tilog' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
React_Cunstom_Hooks ์ ์ฉ_(1)react.lazy์ Suspense (0) | 2022.07.31 |
---|---|
BlogDetail ์ปดํฌ๋ํธ(BlogDetail.js) (0) | 2022.07.29 |
useMemo_๋ฆฌ์กํธ ์ฌํ (0) | 2022.07.28 |
useCallback_๋ฆฌ์กํธ ์ฌํ (0) | 2022.07.28 |
๋น๋์ ๋ฒ๋ค๋ง (0) | 2022.07.28 |