summaryrefslogtreecommitdiffhomepage
path: root/plugin/multiplex/index.js
diff options
context:
space:
mode:
authorGreg Denehy2017-04-30 17:42:16 +0930
committerGreg Denehy2017-04-30 17:42:16 +0930
commitf8bc6791827b7a291081a32ef3d86f5e23d186e7 (patch)
tree87b004b3f1b0575757de6c42bace8f5330926ae0 /plugin/multiplex/index.js
parent40a46e1c0c7836bdc26d25993a5c785be82e9973 (diff)
parent360bc940062711db9b8020ce4e848f6c37014481 (diff)
Merge branch 'dev' into plugin-key-bindings
Diffstat (limited to 'plugin/multiplex/index.js')
-rw-r--r--plugin/multiplex/index.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugin/multiplex/index.js b/plugin/multiplex/index.js
index 40c1661..8195f04 100644
--- a/plugin/multiplex/index.js
+++ b/plugin/multiplex/index.js
@@ -31,7 +31,15 @@ io.on( 'connection', function( socket ) {
app.get("/", function(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
- fs.createReadStream(opts.baseDir + '/index.html').pipe(res);
+
+ var stream = fs.createReadStream(opts.baseDir + '/index.html');
+ stream.on('error', function( error ) {
+ res.write('<style>body{font-family: sans-serif;}</style><h2>reveal.js multiplex server.</h2><a href="/token">Generate token</a>');
+ res.end();
+ });
+ stream.on('readable', function() {
+ stream.pipe(res);
+ });
});
app.get("/token", function(req,res) {