diff options
Diffstat (limited to 'mascara/server/index.js')
-rw-r--r-- | mascara/server/index.js | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/mascara/server/index.js b/mascara/server/index.js index 6fb1287cc..a30120438 100644 --- a/mascara/server/index.js +++ b/mascara/server/index.js @@ -1,7 +1,5 @@ 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 @@ -9,27 +7,14 @@ module.exports = createMetamascaraServer function createMetamascaraServer () { - // start bundlers - 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 + // setup server const server = express() server.use(compression()) - // ui window - serveBundle(server, '/ui.js', uiBundle) + // serve assets 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(path.join(__dirname, '/../proxy'))) - // background - serveBundle(server, '/background.js', backgroundBuild) + server.use(express.static(path.join(__dirname, '/../../dist/mascara'))) + server.use(express.static(path.join(__dirname, '/../proxy'))) return server |