aboutsummaryrefslogtreecommitdiffstats
path: root/mascara/server/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'mascara/server/index.js')
-rw-r--r--mascara/server/index.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/mascara/server/index.js b/mascara/server/index.js
new file mode 100644
index 000000000..14e3fa18e
--- /dev/null
+++ b/mascara/server/index.js
@@ -0,0 +1,32 @@
+const express = require('express')
+const createBundle = require('./util').createBundle
+const serveBundle = require('./util').serveBundle
+
+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')
+
+ // serve bundles
+ const server = express()
+ // ui window
+ serveBundle(server, '/ui.js', uiBundle)
+ server.use(express.static(__dirname+'/../ui/'))
+ server.use(express.static(__dirname+'/../../dist/chrome'))
+ // metamascara
+ serveBundle(server, '/metamascara.js', metamascaraBundle)
+ // proxy
+ serveBundle(server, '/proxy/proxy.js', proxyBundle)
+ server.use('/proxy/', express.static(__dirname+'/../proxy'))
+ // background
+ serveBundle(server, '/background.js', backgroundBuild)
+
+ return server
+
+}