json-server
셋팅하기 공식문서→ https://www.npmjs.com/package/json-server
json-server
Get a full fake REST API with zero coding in less than 30 seconds. Latest version: 0.17.3, last published: 3 months ago. Start using json-server in your project by running `npm i json-server`. There are 315 other projects in the npm registry using json-ser
www.npmjs.com
1. 설치
npm install json-server
// or
yarn add json-server
2. 실행 (기존 포트 영향주지 않기 위해 다른 포트 명령 사용)
json-server --watch db.json --port 4000
3. 로컬호스트 확인!
// db.json
{
"posts": [
{
"id": 1,
"title": "json-server",
"author": "typicode"
}
],
"comments": [
{
"id": 1,
"body": "some comment",
"postId": 1
}
],
"profile": {
"name": "typicode"
}
}
'What I Learnd > TIL' 카테고리의 다른 글
TIL - REST API 개념과 예시 (0) | 2023.07.08 |
---|---|
Axios - instance와 interceptor 정의, .env와 api파일로 리팩토링하기 (0) | 2023.07.05 |
TIL - Redux-ToolKit 리덕스 툴킷이란? (0) | 2023.07.04 |
TIL - git 원격저장소 주소 변경하기 (git remote repository) (0) | 2023.06.27 |
TIL - Commit Message Convention (0) | 2023.06.27 |