단순한 문자열 대신 HTML을 응답하고 싶다면 res.sendFile 메서드를 사용하면 됩니다. 단, 파일의 경로를 path 모듈을 사용해서 지정해야 합니다.
index.html
<html>
<head>
<meta charset="UTF-8" />
<title>익스프레스 서버</title>
</head>
<body>
<h1>익스프레스</h1>
<p>배워봅시다.</p>
</body>
</html>
단순한 문자열 대신 HTML을 응답하고 싶다면 res.sendFile 메서드를 사용하면 됩니다. 단, 파일의 경로를 path 모듈을 사용해서 지정해야 합니다.
index.html
<html>
<head>
<meta charset="UTF-8" />
<title>익스프레스 서버</title>
</head>
<body>
<h1>익스프레스</h1>
<p>배워봅시다.</p>
</body>
</html>