postman 오류 질문
336
작성한 질문수 1
안녕하세요 ! 수업 잘 듣고 있습니다
postman 에서 send 하면 오류가 나는데 어디가 잘못된 걸까요?
index.js 소스 첨부합니다 !
const express = require('express')
const app = express()
const port = 5000
const bodyParser = require('body-parser');
const { User } = require("./models/User");
app.use(bodyParser.urlencoded({extended:true}));
app.use(bodyParser.json());
const mongoose = require('mongoose')
mongoose.connect('mongodb+srv://root:1234@boilerplate.ielul.mongodb.net/<dbname>?retryWrites=true&w=majority',{
useNewUrlParser:true,useUnifiedTopology:true,useCreateIndex:true,useFindAndModify:false
}).then(()=>console.log('MongoDB Connected...'))
.catch(err=>console.log(err))
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.post('/register',(req,res)=>{
//회원 가입시 필요한 정보를 클라이언트에서 가져오면
//데이터베이스에 넣는다
const user = new User(req.body)
user.save((err,userInfo)=>{
if(err) return res.json({success:false,err})
return res.status(200).json({
success:true
})
})
})
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})

답변 3
0
위에 포스트맨에,
localhost:5000/register (X)
http://localhost:5000/register (O)
이렇게 주소 바꿔줘보세용
깃 이메일이랑 비번이 필요하다고 하네요
0
34
1
404 에러
0
101
1
34강 인증 체크에서 element 사용 때문에 에러나시는 분들 이렇게 하심 됩니다.
0
118
1
로그인, 로그아웃, 토근 작동 안 함
0
238
0
9강 오류 어떻게 해결하나요?
0
193
1
localhost 에서 연결을 거부했습니다.
0
1924
4
포스트맨에서 true가 안떠요
0
150
1
왜 안되나요
0
128
1
몽고db 연결 오류가 납니다 위에껀 입력한 코드, 아래껀 터미널이에요
0
243
1
로그아웃 401 에러(Unauthorized)
0
503
2
암호가 해싱되지 않고 입력값 그대로 db에 저장되는 문제
0
148
1
7강중에서
0
162
2
User.findByToken is not a function
0
210
1
루트 디렉토리
0
268
1
useState
0
560
1
프록시 잘 설정했는데도 404 오류 뜨는 분들
5
874
6
webpack 관련 에러 질문
0
218
1
리액트 관련 질문
0
271
1
14강 로그아웃 안됨
0
318
1
mongoDB 데이터 확인하는 법
0
408
1
postman 에러
0
290
1
선생님 리덕스를 사용하면 어떠한 부분이 좋은지 알 수 있을까요?
0
233
1
다음과 같은 에러들이 발생합니다.
0
272
1
14강 로그아웃 기능 구현시 postman에서 Cannot POST 오류가 뜹니다.
0
379
1






