|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
|
|
const path = require('path') |
|
|
|
const express = require('express') |
|
|
|
const express = require('express') |
|
|
|
const createBundle = require('./util').createBundle |
|
|
|
const createBundle = require('./util').createBundle |
|
|
|
const serveBundle = require('./util').serveBundle |
|
|
|
const serveBundle = require('./util').serveBundle |
|
|
@ -8,22 +9,22 @@ module.exports = createMetamascaraServer |
|
|
|
function createMetamascaraServer () { |
|
|
|
function createMetamascaraServer () { |
|
|
|
|
|
|
|
|
|
|
|
// start bundlers
|
|
|
|
// start bundlers
|
|
|
|
const metamascaraBundle = createBundle(__dirname + '/../src/mascara.js') |
|
|
|
const metamascaraBundle = createBundle(path.join(__dirname, '/../src/mascara.js')) |
|
|
|
const proxyBundle = createBundle(__dirname + '/../src/proxy.js') |
|
|
|
const proxyBundle = createBundle(path.join(__dirname, '/../src/proxy.js')) |
|
|
|
const uiBundle = createBundle(__dirname + '/../src/ui.js') |
|
|
|
const uiBundle = createBundle(path.join(__dirname, '/../src/ui.js')) |
|
|
|
const backgroundBuild = createBundle(__dirname + '/../src/background.js') |
|
|
|
const backgroundBuild = createBundle(path.join(__dirname, '/../src/background.js')) |
|
|
|
|
|
|
|
|
|
|
|
// serve bundles
|
|
|
|
// serve bundles
|
|
|
|
const server = express() |
|
|
|
const server = express() |
|
|
|
// ui window
|
|
|
|
// ui window
|
|
|
|
serveBundle(server, '/ui.js', uiBundle) |
|
|
|
serveBundle(server, '/ui.js', uiBundle) |
|
|
|
server.use(express.static(__dirname + '/../ui/', { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') })) |
|
|
|
server.use(express.static(path.join(__dirname, '/../ui/', { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') }))) |
|
|
|
server.use(express.static(__dirname + '/../../dist/chrome')) |
|
|
|
server.use(express.static(path.join(__dirname, '/../../dist/chrome'))) |
|
|
|
// metamascara
|
|
|
|
// metamascara
|
|
|
|
serveBundle(server, '/metamascara.js', metamascaraBundle) |
|
|
|
serveBundle(server, '/metamascara.js', metamascaraBundle) |
|
|
|
// proxy
|
|
|
|
// proxy
|
|
|
|
serveBundle(server, '/proxy/proxy.js', proxyBundle) |
|
|
|
serveBundle(server, '/proxy/proxy.js', proxyBundle) |
|
|
|
server.use('/proxy/', express.static(__dirname + '/../proxy')) |
|
|
|
server.use('/proxy/', express.static(path.join(__dirname, '/../proxy'))) |
|
|
|
// background
|
|
|
|
// background
|
|
|
|
serveBundle(server, '/background.js', backgroundBuild) |
|
|
|
serveBundle(server, '/background.js', backgroundBuild) |
|
|
|
|
|
|
|
|
|
|
|