JSON Server × CRUD

과정

1. 설치

2. public 폴더 생성

3. postman 파라미터 사용해보기

4. postman CRUD 사용해 보기

파라미터 사용 방법

Filter

Use . to access deep properties (하위 속성을 선택 할 때는 .을 사용해라)

GET /posts?title=json-server&author=typicode
GET /posts?id=1&id=2
GET /comments?author.name=typicode

Sort (정렬)

Add _sort and _order (ascending order by default)

GET /posts?_sort=views&_order=asc
GET /posts/1/comments?_sort=votes&_order=asc

For multiple fields, use the following format:

GET /posts?_sort=user,views&_order=desc,asc

Slice (특정 데이터만 추출)

Add _start and _end or _limit (an X-Total-Count header is included in the response)

GET /posts?_start=20&_end=30
GET /posts/1/comments?_start=20&_end=30
GET /posts/1/comments?_start=20&_limit=10

Works exactly as Array.slice (i.e. _start is inclusive and _end exclusive)

Add q

GET /posts?q=internet

참고

Last updated

Was this helpful?