aboutsummaryrefslogtreecommitdiffstats
path: root/mascara/server/index.js
diff options
context:
space:
mode:
authorLe Quoc Viet <vietlq85@gmail.com>2018-03-15 16:11:42 +0800
committerGitHub <noreply@github.com>2018-03-15 16:11:42 +0800
commit04079455e36e48433cf8055c8f1f79e1e7e18298 (patch)
treed7de2a6603b67b56abacf09bee4d2bbbfe886b8f /mascara/server/index.js
parent5bdee96e73f65a0b369277e9c56b0afe5159e65b (diff)
parente2efc91aee64072c408ab509219dcbfb389c7609 (diff)
downloadtangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar.gz
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar.bz2
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar.lz
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar.xz
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.tar.zst
tangerine-wallet-browser-04079455e36e48433cf8055c8f1f79e1e7e18298.zip
Merge pull request #1 from MetaMask/master
Merge from the source
Diffstat (limited to 'mascara/server/index.js')
-rw-r--r--mascara/server/index.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/mascara/server/index.js b/mascara/server/index.js
index 12b527e5d..6fb1287cc 100644
--- a/mascara/server/index.js
+++ b/mascara/server/index.js
@@ -1,6 +1,8 @@
+const path = require('path')
const express = require('express')
const createBundle = require('./util').createBundle
const serveBundle = require('./util').serveBundle
+const compression = require('compression')
module.exports = createMetamascaraServer
@@ -8,22 +10,24 @@ module.exports = createMetamascaraServer
function createMetamascaraServer () {
// start bundlers
- const metamascaraBundle = createBundle(__dirname + '/../src/mascara.js')
- const proxyBundle = createBundle(__dirname + '/../src/proxy.js')
- const uiBundle = createBundle(__dirname + '/../src/ui.js')
- const backgroundBuild = createBundle(__dirname + '/../src/background.js')
+ const metamascaraBundle = createBundle(path.join(__dirname, '/../src/mascara.js'))
+ const proxyBundle = createBundle(path.join(__dirname, '/../src/proxy.js'))
+ const uiBundle = createBundle(path.join(__dirname, '/../src/ui.js'))
+ const backgroundBuild = createBundle(path.join(__dirname, '/../src/background.js'))
// serve bundles
const server = express()
+ server.use(compression())
+
// ui window
serveBundle(server, '/ui.js', uiBundle)
- server.use(express.static(__dirname + '/../ui/'))
- server.use(express.static(__dirname + '/../../dist/chrome'))
+ server.use(express.static(path.join(__dirname, '/../ui/'), { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') }))
+ server.use(express.static(path.join(__dirname, '/../../dist/chrome')))
// metamascara
serveBundle(server, '/metamascara.js', metamascaraBundle)
// proxy
serveBundle(server, '/proxy/proxy.js', proxyBundle)
- server.use('/proxy/', express.static(__dirname + '/../proxy'))
+ server.use('/proxy/', express.static(path.join(__dirname, '/../proxy')))
// background
serveBundle(server, '/background.js', backgroundBuild)