Giter Club home page Giter Club logo

umc-5th-smuflix-be's Introduction

SMUFLIX BE 사용법

npm install
npm start

API 명세서

POST/auth/signup

Reqeust

{
  "name": "김용민",
  "email": "[email protected]",
  "age": "24",
  "username": "dydals3440",
  "password": "Smu123!!",
  "passwordCheck": "Smu123!!"
}

회원가입이 성공한 경우 (success: 201)

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjE2OTk4ODczODM3NTYiLCJpYXQiOjE2OTk4ODczODMsImV4cCI6MTY5OTg4NzU1NX0.3L2ydwyCfHsfQGXbcb-hnPgNWEqLRNSb9lTXB-FShKs",
  "username": "username"
}

이미 존재하는 아이디인경우 (error: 409)

Response

{
  "message": "username already exists"
}

비밀번호가 일치하지 않는경우 (error: 400)

{
  "message": "Passwords do not match"
}

POST/auth/login

Reqeust

{
  "username": "dydals3440",
  "password": "Smu123!!"
}

Response (Success: 200)

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEiLCJpYXQiOjE2OTk4NzEyMTUsImV4cCI6MTY5OTg3MTM4N30.wXB7z24Fg0THjO910rfxC9z4H2B8Fq2ty4QjFillB5o",
  "username": "username"
}

로그인 실패시 (아이디or 비밀번호가 잘못됬을 시)(error: 401)

{
  "message": "Invalid user or password"
}

GET /auth/me (필요 유저 정보 토큰 헤더에 첨부해서 받아오기)

request시, 따로 body로 데이터 전송을 안해주어도 되고, 로그인 시 얻는 토큰을 헤더에 넘겨주시면 됩니다. Authorization: Bearer token

유효한 토큰일시 유저 정보를 아래와 같이 전달받습니다. (Success: 200)

{
  "username": "dydals3440",
  "name": "김용민",
  "age": "24",
  "email": "[email protected]"
}

유효하지 않은 토큰일시 (Error 404)

{
  "message": "User not found"
}

umc-5th-smuflix-be's People

Contributors

dydals3440 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.