-
카테고리
-
세부 분야
백엔드
-
해결 여부
해결됨
[기본 nodeJS 서버 만들기] res.send is not a function
23.11.04 10:48 작성 조회수 259
0
const http = require('http');
const host = 'localhost';
const port = 3000;
const server = http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/html'});
res.send('<h1>Hello World</h1>');
});
server.listen(port, host, () => {
console.log('Server running on http://localhost:3000...');
});
TypeError: res.send is not a function
이런 에러가 발생하는데 이유를 알 수 있을까요?
답변을 작성해보세요.
0
답변 1