음원 소비 플랫폼의 웹 백엔드 서버 구현
Nodejs v12.0.0 이상
Nest Js
git pull // 최신 파일로 업데이트하기
npm i // package 다운 받기(1번만 받으면 된다. node_modules 폴더 존재 해야함.)
npm run start:dev // 서버 실행하기
- Sign Up
- api : http://localhost:8000/api/v1/user/signup
- req.body :
// json / formdata
{
"email" : "[email protected]",
"password" : "test1",
"nickname" : "test1",
"metamaskId" : "test1"
}
- res.body :
{
"id": "621340c45a422ca4f5e0dc02",
"email": "[email protected]",
"nickname": "test2",
"metamaskId": "test2"
}
- Sign In
- api : http://localhost:8000/api/v1/user/signin
- req.body :
// json / formdata
{
"email" : "[email protected]",
"password" : "test1",
"metamaskId" : "test1"
}
- res.body :
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyQGRvbWFpbi5jb20iLCJtZXRhbWFza0lkIjoidGVzdDIiLCJzdWIiOiI2MjEzNDBjNDVhNDIyY2E0ZjVlMGRjMDIiLCJpYXQiOjE2NDU0MzQzMDgsImV4cCI6MTY0NTQzNzkwOH0.O3K5Frt-GfOYbYG1XjkQ7_OFKfEC4ZceEsZEgnefolg"
}
- Current User
- api : http://localhost:8000/api/v1/user/current
- req.header :
// json / formdata
{
"Authorization" : "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyQGRvbWFpbi5jb20iLCJtZXRhbWFza0lkIjoidGVzdDIiLCJzdWIiOiI2MjEzNDBjNDVhNDIyY2E0ZjVlMGRjMDIiLCJpYXQiOjE2NDU0MzQzMDgsImV4cCI6MTY0NTQzNzkwOH0.O3K5Frt-GfOYbYG1XjkQ7_OFKfEC4ZceEsZEgnefolg"
}
- res.body :
{
"id": "621340c45a422ca4f5e0dc02",
"email": "[email protected]",
"nickname": "test2",
"metamaskId": "test2"
}