mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-23 23:48:07 +00:00
Fix prod and beta local servers
This commit is contained in:
parent
76a09e39b6
commit
258df74c0d
@ -21,13 +21,15 @@
|
||||
"test": "run-s test:*",
|
||||
"test:unit": "npx jest",
|
||||
"test-unit:watch": "npx jest -o --watch",
|
||||
"prod-server": "node ./server/index.js"
|
||||
"server:beta": "node ./server/index.js --buildType=beta",
|
||||
"server:prod": "node ./server/index.js --buildType=prod"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel": "^6.23.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"bignumber.js": "2.4.0",
|
||||
"color-hash": "^1.0.3",
|
||||
"commander": "^2.19.0",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
"cross-env": "^5.2.0",
|
||||
"date-fns": "^1.29.0",
|
||||
|
@ -3,6 +3,12 @@ const morgan = require('morgan');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
const commander = require('commander');
|
||||
|
||||
commander
|
||||
.version('0.1.0')
|
||||
.option('-b, --buildType [type]', 'Set the build type')
|
||||
.parse(process.argv);
|
||||
|
||||
const privateKey = fs.readFileSync('server/key.pem').toString();
|
||||
const certificate = fs.readFileSync('server/cert.pem').toString();
|
||||
@ -16,11 +22,11 @@ const PORT = process.env.PORT || 8080;
|
||||
app.use(morgan(':remote-addr - :remote-user [:date[clf]] ":method :url HTTP/:http-version" :status :res[content-length] :response-time ms'));
|
||||
|
||||
// Serve static assets
|
||||
app.use(express.static(path.resolve(__dirname, '..', 'build')));
|
||||
app.use(express.static(path.resolve(__dirname, '..', 'build', commander.buildType)));
|
||||
|
||||
// Always return the main index.html, so react-router render the route in the client
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.resolve(__dirname, '..', 'build', 'index.html'));
|
||||
res.sendFile(path.resolve(__dirname, '..', 'build', commander.buildType, 'index.html'));
|
||||
});
|
||||
|
||||
const httpsServer = https.createServer(credentials, app);
|
||||
|
@ -2570,6 +2570,10 @@ commander@^2.13.0:
|
||||
version "2.18.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970"
|
||||
|
||||
commander@^2.19.0:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
|
||||
|
||||
commander@^2.8.1:
|
||||
version "2.17.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
|
||||
|
Loading…
Reference in New Issue
Block a user