GET /userlist?page={Number}&limit={Number}
http://localhost:5000/userList?page=1&limit=5
cf) /userlist?page={Number} 혹은 /userlist?limit={Number}
⇒ /userlist 와 같은 결과(전체 조회)를 얻는다.
HEADERS
로그인 된 상태에서 해야 돼서 헤더에 jwt 토큰 필요
**Authorization :** bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYzQxZjA0MDgtYzJmZi00NWQwLWFlZTQtMzdiODllMzA3NjY2IiwiaWF0IjoxNjQ3ODc1OTYxfQ.Xb16gunjLeqnnW4VvXI3VhT4xqkcQW-QUxmW4BtCPgM
Response
http://localhost:5001/userlist?page=1&limit=5
이제 배열이 아니라 객체를 반환 합니다. 마지막 페이지는 lastPage에 있고
유저 정보 배열은 data에 있습니다.
{
"lastPage": 3,
"data": [
{
"_id": "6232cdec11163c9f5055ff7c",
"id": "35743b4e-02e6-4c72-a961-f089066e5c6b",
"email": "[email protected]",
"name": "테스트 계정",
"description": "안녕하세요! 테스트입니다!!",
"createdAt": "2022-03-17T05:58:04.245Z",
"updatedAt": "2022-03-23T04:29:36.927Z",
"__v": 0
},
{
"_id": "6232d673407621b10d4f92e3",
"id": "a354feec-f0fc-475d-8791-8926cda32cff",
"email": "[email protected]",
"name": "테스트",
"description": "설명이 아직 없습다. 추가해 주세요.",
"createdAt": "2022-03-17T06:34:27.875Z",
"updatedAt": "2022-03-24T01:18:28.347Z",
"__v": 0
},
{
"_id": "6232d6fd6a3d41b0e317f828",
"id": "a39a9879-fd06-40f7-9cb6-0b01e0379125",
"email": "[email protected]",
"name": "me",
"description": "설명이 아직 없습니다. 추가해 주세요.",
"createdAt": "2022-03-17T06:36:45.927Z",
"updatedAt": "2022-03-21T09:45:28.018Z",
"__v": 0
},
{
"_id": "6232e9c20cb9033a0d6d156a",
"id": "806e91c2-9768-481a-91a8-b78c03b648b8",
"email": "[email protected]",
"name": "김광태",
"description": "설명이 아직 없습니다. 추가해 주세요.",
"createdAt": "2022-03-17T07:56:50.255Z",
"updatedAt": "2022-03-17T07:56:50.255Z",
"__v": 0
},
{
"_id": "62331b7d7ccd6591b2043d5b",
"id": "0ba35617-dec1-4118-a737-06dbc1f840f9",
"email": "[email protected]",
"name": "kl",
"description": "설명이 아직 없습니다. 추가해 주세요.",
"createdAt": "2022-03-17T11:29:01.836Z",
"updatedAt": "2022-03-17T11:29:01.836Z",
"__v": 0
}
]
}