0
localhost에 HTTPS 서버를 설정하려고했지만 서버가 실행 중일 때 html 파일을 렌더링하는 방법을 모르겠습니다. ') 함수되지 .render (', 대안은 무엇인가노드 Js가있는 HTTPS 렌더링 html 파일
var https = require('https'); var fs = require('fs');
var options = { key: fs.readFileSync('client-key.pem'),
cert: fs.readFileSync('client-cert.pem') };
var a = https.createServer(options, function (req, res) {
console.log('Server is starting');
res.writeHead(200);
// res.end("hello world\n");
res.render('index.html');
}).listen(8000);
내가 로컬 호스트에 액세스 할 수 있습니다,하지만 난 HTML 파일을 렌더링하려 할 때마다, 나는의 오류 메시지를 받았습니다 : 다음은 내 코드입니다 서버가 실행 중일 때 html 파일을 '호출'합니다. 어떤 도움을 주셔서 감사합니다!
안녕하세요 내부에,이 코드는 정말 감사합니다, 저를 위해 일을해야합니다! 감사!! – JackPowell