-
Notifications
You must be signed in to change notification settings - Fork 0
API 문서
Minho Kim edited this page Feb 1, 2018
·
7 revisions
Server | Domain |
---|---|
WAServer | localhost:3030 |
Auth Server | localhost:3000 |
HTTP Header | Value |
---|---|
Domain | (Auth Server) |
Method | POST |
URI Path | /auth/local |
Body Key | Value | Format | comment |
---|---|---|---|
uid | (유저 아이디) | String | 유저 아이디 |
password | (유저 패스워드) | String | 유저 패스워드 |
HTTP Header | Value |
---|---|
Content-Type | application/json |
Access-Control-Allow-Origin | * |
Access-Control-Allow-Headers | origin, x-requested-with, content-type, accept |
Body Key | Value | Format | comment |
---|---|---|---|
success | true or false | boolean | 성공 여부 |
data | {} | Object | 요청에 대한 응답 메세지 |
uid | (유저 아이디) | String | 유저 아이디 |
(유저 이메일) | String | 유저 이메일 | |
token | (토큰) | String | 엑세스 토큰 값 |
example
{
success: true,
data: {
uid: "홍길동",
email: "test@test.com",
token: "(엑세스 토큰 값)"
}
}
HTTP Header | Value |
---|---|
Domain | (WasServer) |
Method | GET |
URI Path | /users/logout |
Nothing
HTTP Header | Value |
---|---|
Content-Type | application/json |
Body Key | Value | Format | comment |
---|---|---|---|
success | true or false | boolean | 성공 여부 |
message | <메세지 내용> | String | 요청에 대한 응답 메세지 |
example
{
success: true,
message: "로그아웃 완료!!"
}
HTTP Header | Value |
---|---|
Domain | (Auth Server) |
Method | POST |
URI Path | /auth/register |
Body Key | Value |
---|---|
uid | (유저 아이디) |
password | (유저 패스워드) |
password2 | (유저 패스워드) |
(유저 이메일) | |
age | (나이) |
gender | male or female |
HTTP Header | Value |
---|---|
Content-Type | application/json |
Access-Control-Allow-Origin | * |
Access-Control-Allow-Headers | origin, x-requested-with, content-type, accept |
Body Key | Value | Format | comment |
---|---|---|---|
success | true or false | boolean | 성공 여부 |
data | {} | Object | 요청에 대한 응답 메세지 |
uid | (유저 아이디) | String | 유저 아이디 |
(유저 이메일) | String | 유저 이메일 | |
gender | male or female | String | 성별 |
age | (나이) | Number | 나이 |
token | (토큰) | String | 엑세스 토큰 값 |
example
{
success: true,
data: {
uid: "홍길동",
email: "test@test.com",
gender: male,
age: "25",
token: "(엑세스 토큰 값)"
}
}
HTTP Header | Value |
---|---|
Domain | (Auth Server) |
Method | POST |
URI Path | /popTag/hotlist |
Nothing
HTTP Header | Value |
---|---|
Content-Type | application/json; charset=utf-8 |
Body Key | Value | Format | comment |
---|---|---|---|
_ | [] | Array | 인기 검색어 배열 |
_ | {} | Object | 인기 검색어 객체 |
name | (인기검색어) | String | 인기 검색어 |
value | (가중치 값) | Number | 인기 검색어 가중치 값 |
example
[
{
name: "인기방1",
value: 50
},
{
name: "인기방2",
value: 39
},
...
]
HTTP Header | Value |
---|---|
Domain | (Auth Server) |
Method | GET |
URI Path | /users/card/ |
Cookie | token="(토큰값)" |
Query | number="(읽어들인 카드 개수)" |
Nothing
HTTP Header | Value |
---|---|
Content-Type | application/json; charset=utf-8 |
Body Key | Value | Format | comment |
---|---|---|---|
success | true or false | boolean | 성공 여부 |
data | [] | Array | 유저의 카드 데이터 Array |
_ | (카드 객체) | Object | 유저의 카드 객체 |
ObjectId | (오브젝트 아이디) | String | mongoDB 카드 오브젝트 Id |
user_ObjectId | (오브젝트 아이디) | String | mongoDB 유저의 오브젝트 Id |
card_id | (카드 id) | Number | 카드 객체의 id |
title | (카드 제목) | String | 카드 객체의 제목 |
content | (카드 내용) | String | 카드 객체의 내용 |
photo_path | (카드 이미지 url) | String | 카드 객체 이미지의 url |
register_time | (카드 생성시간) | Date | 카드 객체의 생성시간 |
tag | [(태그이름), ...] | Array | 카드 객체가 가진 태그의 배열 |
example
{
successs: true,
data : [
{
"ObjectId": "5a72892200301b1e04b69f12",
"user_ObjectId": "5a6ebb805b78e0293882e237",
"card_id": 26,
"title": "닭장속에는 암탉이",
"content": "꼬꼬댁 꼬꼬꼬꼬",
"photo_path": "http://localhost:3030/images/uploads/김민호-1517455650120-35071-239710.jpg",
"register_time": "2018-02-01T03:24:35.693Z",
"tag": [
"#암탉",
"#귀여웡",
"#닭"
]
},
...
]
}
HTTP Header | Value |
---|---|
Domain | (Auth Server) |
Method | POST |
URI Path | /users/card/ |
Cookie | token="(토큰값)" |
Query | number="(읽어들인 카드 개수)" |
Content-Type | multipart/form |
Body Key | Value |
---|---|
title | (카드 제목) |
content | (카드 내용) |
user_ObjectId | (오브젝트Id) |
tag | [(태그), ...] |
photo_path | 사진 |
HTTP Header | Value |
---|---|
Content-Type | application/json; charset=utf-8 |
Body Key | Value | Format | comment |
---|---|---|---|
success | true or false | boolean | 성공 여부 |
data | {} | Object | 유저의 카드 데이터 객체 |
card_id | (카드 아이디) | Number | 카드 객체의 id |
example
{
successs: true,
data : {
card_id: 20
}
}