반응형
Notice
Recent Posts
Recent Comments
Link
taenyLog
res.send res.render 본문
반응형
res.send
The res.send() function basically sends the HTTP response. The body parameter can be a String or a Buffer object or an object or an Array.
Syntax:
res.send( [body] )
Parameter: This function accepts a single parameter body that describes the body which is to be sent in the response.
Returns: It returns an Object.
res.render
The res.render() function is used to render a view and sends the rendered HTML string to the client.
Syntax:
res.render(view [, locals] [, callback])
Parameters: This function accepts two parameters as mentioned above and described below:
Locals: It is basically an object whose properties define local variables for the view.
Callback It is a callback function.
Returns: It returns an Object.
반응형
'Web' 카테고리의 다른 글
http://localhost:3000 에러 (0) | 2023.06.28 |
---|---|
MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 에러 해결 (0) | 2023.06.28 |
Mongoose | 업데이트/삭제/스키마/메서드/미들웨어 (0) | 2023.06.25 |
파워셸에서 몽고DB접속/깃배시에서 Node.JS (0) | 2023.06.25 |
node .load index.js 버그 (0) | 2023.06.25 |