aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/slidenotes/index.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/slidenotes/index.js b/lib/slidenotes/index.js
index 26b0463..1c0585c 100644
--- a/lib/slidenotes/index.js
+++ b/lib/slidenotes/index.js
@@ -10,34 +10,34 @@ var staticDir = express.static;
io = io.listen(app);
var opts = {
- port : 1947,
- baseDir : __dirname + '/../../'
+ port : 1947,
+ baseDir : __dirname + '/../../'
};
io.sockets.on('connection', function(socket) {
- socket.on('slidechanged', function(slideData) {
- socket.broadcast.emit('slidedata', slideData);
- });
+ socket.on('slidechanged', function(slideData) {
+ socket.broadcast.emit('slidedata', slideData);
+ });
});
app.configure(function() {
- [ 'css', 'assets', 'js', 'lib' ].forEach(function(dir) {
- app.use('/' + dir, staticDir(opts.baseDir + dir));
- });
+ [ 'css', 'assets', 'js', 'lib' ].forEach(function(dir) {
+ app.use('/' + dir, staticDir(opts.baseDir + dir));
+ });
});
app.get("/", function(req, res) {
- fs.createReadStream(opts.baseDir + '/index.html').pipe(res);
+ fs.createReadStream(opts.baseDir + '/index.html').pipe(res);
});
app.get("/_notes/:socketId", function(req, res) {
- fs.readFile(opts.baseDir + 'slidenotes/notes.html', function(err, data) {
- res.send(Mustache.to_html(data.toString(), {
- socketId : req.params.socketId
- }));
- });
- // fs.createReadStream(opts.baseDir + 'slidenotes/notes.html').pipe(res);
+ fs.readFile(opts.baseDir + 'lib/slidenotes/notes.html', function(err, data) {
+ res.send(Mustache.to_html(data.toString(), {
+ socketId : req.params.socketId
+ }));
+ });
+ // fs.createReadStream(opts.baseDir + 'slidenotes/notes.html').pipe(res);
});
// Actually listen