|
|
@ -15,22 +15,21 @@ function createMetamascaraServer () { |
|
|
|
const uiBundle = createBundle(path.join(__dirname, '/../src/ui.js')) |
|
|
|
const uiBundle = createBundle(path.join(__dirname, '/../src/ui.js')) |
|
|
|
const backgroundBuild = createBundle(path.join(__dirname, '/../src/background.js')) |
|
|
|
const backgroundBuild = createBundle(path.join(__dirname, '/../src/background.js')) |
|
|
|
|
|
|
|
|
|
|
|
// serve bundles
|
|
|
|
// setup server
|
|
|
|
const server = express() |
|
|
|
const server = express() |
|
|
|
server.use(compression()) |
|
|
|
server.use(compression()) |
|
|
|
|
|
|
|
|
|
|
|
// ui window
|
|
|
|
// serve bundles
|
|
|
|
serveBundle(server, '/scripts/ui.js', uiBundle) |
|
|
|
|
|
|
|
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) |
|
|
|
serveBundle(server, '/metamascara.js', metamascaraBundle) |
|
|
|
// proxy
|
|
|
|
serveBundle(server, '/scripts/ui.js', uiBundle) |
|
|
|
serveBundle(server, '/scripts/proxy.js', proxyBundle) |
|
|
|
serveBundle(server, '/scripts/proxy.js', proxyBundle) |
|
|
|
server.use('/', express.static(path.join(__dirname, '/../proxy'))) |
|
|
|
|
|
|
|
// background
|
|
|
|
|
|
|
|
serveBundle(server, '/scripts/background.js', backgroundBuild) |
|
|
|
serveBundle(server, '/scripts/background.js', backgroundBuild) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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/mascara'))) |
|
|
|
|
|
|
|
server.use(express.static(path.join(__dirname, '/../proxy'))) |
|
|
|
|
|
|
|
|
|
|
|
return server |
|
|
|
return server |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|