-
카테고리
-
세부 분야
풀스택
-
해결 여부
미해결
질문이여
19.08.18 05:19 작성 조회수 113
0
질문
url.parse가 정확히 무슨 역할을하는지 모르겟네요.
밑에 보시는바와 같이, localhost:8003에서 localhost:8002로 요청보낼때, 인데요.
console.log(req.get('origin'))
이런식으로 로그 찍어보면, 이런 값이 나오는데
http://localhost:8003
url.parse를 하면, 모든 값이 나오는데,
왜그런건가요 ?? ??
console.log(url.parse(req.get('origin')))
Url {
protocol: 'http:',
slashes: true,
auth: null,
host: 'localhost:8003',
port: '8003',
hostname: 'localhost',
hash: null,
search: null,
query: null,
pathname: '/',
path: '/',
href: 'http://localhost:8003/'
}
답변을 작성해보세요.
0
답변 1