Node.js

[06.09] 소셜 로그인 01 - postman

ljw4104 2021. 6. 9. 11:44
  1. express {프로젝트 이름}
  2. cd {프로젝트가 설치된 폴더}
  3. npm install
  4. 정상적으로 설치되었으면 npm start후에 localhost:3000 실행 시에 default 페이지가 동작해야한다.


Nodemon 설치

  1. npm i nodemon -g (전역설치)
  2. package.json에서 "start" : "node~~를 nodemon으로 바꾸기
  3. npm start

POST로 데이터 전송이 잘 되어있다.

 

routes/users.js

router.post('/', function (req, res, next) {
  console.log(req.body);
  res.send("post, /users");
});