Updates for HTTPS and UX
This commit is contained in:
Родитель
75cae040a7
Коммит
50ea6da36c
35
app.js
35
app.js
|
@ -1,6 +1,7 @@
|
|||
const express = require('express');
|
||||
const bodyParser = require('body-parser');
|
||||
const cookieParser = require('cookie-parser');
|
||||
const https = require('https');
|
||||
|
||||
const app = express();
|
||||
const router = express.Router();
|
||||
|
@ -21,7 +22,33 @@ require('./lib/app-router')(router);
|
|||
|
||||
app.use('/api', router);
|
||||
|
||||
const port = process.env.PORT || 8080;
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening on port ${port}!`);
|
||||
});
|
||||
|
||||
|
||||
const port = process.env.PORT || 8443;
|
||||
|
||||
// if local, use 8443 and certificate
|
||||
if (process.env.NODE_ENV === 'dev') {
|
||||
|
||||
const passPhrase = process.env.PASS_PHRASE;
|
||||
const certPem = process.env.CERT_PEM.replace(/\\n/g, '\n');
|
||||
const keyPem = process.env.KEY_PEM.replace(/\\n/g, '\n');
|
||||
|
||||
const sslOptions = {
|
||||
key: keyPem,
|
||||
cert: certPem,
|
||||
passphrase: passPhrase
|
||||
};
|
||||
|
||||
const httpsServer = https.createServer(sslOptions, app);
|
||||
|
||||
httpsServer.listen(port, () => {
|
||||
console.log(`Example app listening on port ${port}!`);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Example app listening on port ${port}!`);
|
||||
});
|
||||
|
||||
}
|
|
@ -19394,7 +19394,7 @@ a.sfdx-logo:visited {
|
|||
resize: none; }
|
||||
|
||||
.sfdx-slim {
|
||||
margin: 0 15%; }
|
||||
margin: 0 5%; }
|
||||
|
||||
.sfdx-wrap {
|
||||
word-wrap: break-word; }
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
"cookie-parser": "^1.4.3",
|
||||
"ejs": "^2.5.6",
|
||||
"express": "^4.15.3",
|
||||
"https": "^1.0.0",
|
||||
"jsforce": "^1.8.0",
|
||||
"pg": "^7.1.2",
|
||||
"pg-pool": "^2.0.3",
|
||||
|
|
|
@ -34,7 +34,7 @@ a.sfdx-logo:visited {
|
|||
}
|
||||
|
||||
.sfdx-slim {
|
||||
margin:0 15%;
|
||||
margin:0 5%;
|
||||
}
|
||||
|
||||
.sfdx-wrap {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<footer>
|
||||
<p class="slds-text-align_center slds-m-top_medium sfdx-note">
|
||||
<p style="height:20px;"/>
|
||||
<div class="slds-text-align_center sfdx-note sfdx-slim slds-m-top_large" style="top:10px;">
|
||||
Written and shared by <a href="https://twitter.com/WadeWegner" target="_blank">Wade Wegner</a> under Apache 2.0 License.
|
||||
<br /> UX designed by <a href="https://www.linkedin.com/in/bencsnyder/" target="_blank">Ben Snyder</a>.
|
||||
</p>
|
||||
</footer>
|
||||
User experience designed by <a href="https://www.linkedin.com/in/bencsnyder/" target="_blank">Ben Snyder</a>.
|
||||
Contributions from <a href="https://twitter.com/andyinthecloud" target="_blank">Andrew Fawcett</a>.
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче