new(all): SSR enabled for test in PROD.
This commit is contained in:
parent
b5d99c3fa4
commit
02898ad898
3 changed files with 28 additions and 15 deletions
|
@ -156,6 +156,17 @@ export class GBMinService {
|
|||
// default.gbui access definition.
|
||||
|
||||
GBServer.globals.server.use('/', express.static(url));
|
||||
GBServer.globals.server.use('/ssr-delay', async (req,res) => {
|
||||
|
||||
const sleep = async ms => {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
};
|
||||
await sleep(10000);
|
||||
res.status(200);
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
|
||||
// Servers the bot information object via HTTP so clients can get
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/ssrdelay">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./css/pragmatismo.css" />
|
||||
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
|
||||
<title>General Bots Community Edition | pragmatismo.io</title>
|
||||
|
|
|
@ -215,7 +215,6 @@ export class GBServer {
|
|||
passphrase: process.env.CERTIFICATE_PASSPHRASE,
|
||||
pfx: fs.readFileSync(process.env.CERTIFICATE_PFX)
|
||||
};
|
||||
};
|
||||
const httpsServer = https.createServer(options, server).listen(port, mainCallback);
|
||||
|
||||
if (process.env.CERTIFICATE2_PFX) {
|
||||
|
@ -226,6 +225,7 @@ export class GBServer {
|
|||
httpsServer.addContext(process.env.CERTIFICATE2_DOMAIN, options);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
server.listen(port, mainCallback);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue