JS/node.js
2022. 6. 28.
[nodeJS] 파일 로드
get요청 시 html 파일 전송 res. sendFile(파일명) // html 파일 전송 app.get('/', function(req, res) { // '/' : 홈 res.sendFile(__dirname + '/index.html') }) const express = require('express'); // 설치한 라이브러리를 첨부 const app = express(); // 첨부한 라이브러리로 객체 생성 // html 파일 전송 app.get('/', function(req, res) { // '/' : 홈 res.sendFile(__dirname + '/index.html') })