Giter Club home page Giter Club logo

personal_blog_project_lv2's Introduction

personal_blog_project_Lv2

personal_blog_project_lv2's People

Contributors

wonbinchoi2353 avatar

Watchers

 avatar

personal_blog_project_lv2's Issues

LV2 코드리뷰

  1. 회원가입쪽 요구사항이 몇가지 누락된것 같습니다. 가능하면 추가해보시죠!
    router.post("/signup", async (req, res) => {
    const { nickname, password, confirm } = req.body;
    if (password !== confirm) {
    res.status(412).json({
    errorMessage: "패스워드가 일치하지 않습니다.",
    });
    return;
    }
    // nickname이 동일한 데이터가 있는지 확인하기 위해 가져오기
    const existsUsers = await User.findOne({ nickname });
    if (existsUsers) {
    // 보안을 위해 인증 메세지는 자세히 설명하지 않음
    res.status(412).json({
    errorMessage: "중복된 닉네임입니다.",
    });
    return;
    }
    try {
    const user = new User({ nickname, password });
    await user.save();
    res.status(201).json({ message: "회원가입에 성공하였습니다." });
    } catch (error) {
    res
    .status(400)
    .json({ message: "요청한 데이터 형식이 올바르지 않습니다." });
    }
    });
  • 닉네임, 비밀번호, 비밀번호 확인을 request에서 전달받기
  • 닉네임은 최소 3자 이상, 알파벳 대소문자(a~z, A~Z), 숫자(0~9)로 구성하기
  • 비밀번호는 최소 4자 이상이며, 닉네임과 같은 값이 포함된 경우 회원가입에 실패로 만들기
  • 비밀번호 확인은 비밀번호와 정확하게 일치하기
  • 데이터베이스에 존재하는 닉네임을 입력한 채 회원가입 버튼을 누른 경우 "중복된 닉네임입니다." 라는 에러메세지를 response에 포함하기
  1. express에서 routing을 구성하고 API 뼈대를 만드는 작업은 모두 이해를 하신것 같습니다. 요구사항의 내용이 대부분 채워져 있네요 (물론 완벽하게는 구현이 안되어 있지만 여기까지 하신것도 대단합니다.) http status code는 상황에 맞게 잘 사용하고 계십니다.

[총평]
mongo로 잘 구현을 해주셨는데 기회 될때 sequelize 사용도 해보셨으면 좋겠습니다. 충분히 하실수 있다고 판단되어요. 요구사항 모두 구현하시느라 고생하셨고 개발하시다가 궁금한게 있거나 모르는게 생기면 언제든 튜터들을 찾아주세요.

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.