const devCerts = require("office-addin-dev-certs");
async function getHttpsOptions() {
const httpsOptions = await devCerts.getHttpsServerOptions();
return { cacert: httpsOptions.ca, key: httpsOptions.key, cert: httpsOptions.cert };
}
getHttpsOptions().then(res=>{
const httpsServer = https.createServer(res, app)
// 设置https的访问端口号
const SSLPORT = 443
// 启动服务器,监听对应的端口
httpsServer.listen(SSLPORT, () => {
console.log(`HTTPS Server is running on: https://localhost:${SSLPORT}`)
})
})