aboutsummaryrefslogtreecommitdiffstats
path: root/mascara/example
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-04-05 13:45:39 +0800
committerkumavis <aaron@kumavis.me>2017-04-05 13:45:39 +0800
commit0cfad78f5decbce04a7fa56e8f80e4fcecd12a79 (patch)
tree79c9198d5ad9db830233c2550eb73ed5e3793460 /mascara/example
parent8b146663483849cb76219bbf610c9ff6c5add68d (diff)
downloadtangerine-wallet-browser-0cfad78f5decbce04a7fa56e8f80e4fcecd12a79.tar
tangerine-wallet-browser-0cfad78f5decbce04a7fa56e8f80e4fcecd12a79.tar.gz
tangerine-wallet-browser-0cfad78f5decbce04a7fa56e8f80e4fcecd12a79.tar.bz2
tangerine-wallet-browser-0cfad78f5decbce04a7fa56e8f80e4fcecd12a79.tar.lz
tangerine-wallet-browser-0cfad78f5decbce04a7fa56e8f80e4fcecd12a79.tar.xz
tangerine-wallet-browser-0cfad78f5decbce04a7fa56e8f80e4fcecd12a79.tar.zst
tangerine-wallet-browser-0cfad78f5decbce04a7fa56e8f80e4fcecd12a79.zip
mascara - rename things + break out mascara asset server
Diffstat (limited to 'mascara/example')
-rw-r--r--mascara/example/app.js (renamed from mascara/example/index.js)0
-rw-r--r--mascara/example/app/index.html (renamed from mascara/example/index.html)4
-rw-r--r--mascara/example/server.js31
3 files changed, 32 insertions, 3 deletions
diff --git a/mascara/example/index.js b/mascara/example/app.js
index aae7ccd19..aae7ccd19 100644
--- a/mascara/example/index.js
+++ b/mascara/example/app.js
diff --git a/mascara/example/index.html b/mascara/example/app/index.html
index 47d6da34f..02323e5f9 100644
--- a/mascara/example/index.html
+++ b/mascara/example/app/index.html
@@ -3,15 +3,13 @@
<html lang="en">
<head>
<meta charset="utf-8">
-
<title>MetaMask ZeroClient Example</title>
-
+ <script src="http://localhost:9001/metamascara.js"></script>
</head>
<body>
<button class="action-button-1">SYNC TX</button>
<button class="action-button-2">ASYNC TX</button>
- <script src="./zero.js"></script>
<script src="./app.js"></script>
</body>
</html> \ No newline at end of file
diff --git a/mascara/example/server.js b/mascara/example/server.js
new file mode 100644
index 000000000..d39c19600
--- /dev/null
+++ b/mascara/example/server.js
@@ -0,0 +1,31 @@
+const express = require('express')
+const createMetamascaraServer = require('../server/')
+const createBundle = require('../server/util').createBundle
+const serveBundle = require('../server/util').serveBundle
+
+//
+// Iframe Server
+//
+
+const mascaraServer = createMetamascaraServer()
+
+// start the server
+const mascaraPort = 9001
+mascaraServer.listen(mascaraPort)
+console.log(`Mascara service listening on port ${mascaraPort}`)
+
+
+//
+// Dapp Server
+//
+
+const dappServer = express()
+
+// serve dapp bundle
+serveBundle(dappServer, '/app.js', createBundle(require.resolve('./app.js')))
+dappServer.use(express.static(__dirname + '/app/'))
+
+// start the server
+const dappPort = '9002'
+dappServer.listen(dappPort)
+console.log(`Dapp listening on port ${dappPort}`)