Linux
[NodeJS] nodejs에서 utf-8로 응답하기
GGoris
2014. 12. 20. 16:43
반응형
nodejs에서 utf-8로 응답하기
response의 writeHead부분에 charset을 추가해주면 됩니다.
example
app.get('/', function(req, res){
//req.session.message = 'Hello World';
res.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'});
res.write("welcome입니다");
res.end();
});
반응형