1. mkcert 설치하기
2. 키파일 생성
$ mkcert -install
$ mkcert "localhost" 127.0.0.1 ::1
3. app.py 모듈 임포트
const https = require('https');
const fs = require("fs");
4. app.py 옵션 셜정(키파일 임포트)
const options = {
key: fs.readFileSync('../keys/localhost-key.pem'),
cert: fs.readFileSync('../keys/localhost.pem'),
}
5. https로 서버 시작
//app.listen(port, () => console.log(`Listening on port ${port}`));
https.createServer(options,app).listen(port, () => {
console.log(`Listening on port ${port}`);
});