From da9099460799fd51035836e120ac99d707a83bde Mon Sep 17 00:00:00 2001 From: bignerd95 Date: Fri, 28 Jun 2013 11:15:38 +0200 Subject: Adjusting example app.get('/', function(req, res) { res.render('index.html'); }); is not needed because app.use(express.static(__dirname + '/public')); allow reading any file from /public folder --- example/express-app.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'example') diff --git a/example/express-app.js b/example/express-app.js index ad8e53c..d82f1b2 100644 --- a/example/express-app.js +++ b/example/express-app.js @@ -19,22 +19,20 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +var MjpegProxy = require('mjpeg-proxy').MjpegProxy; var express = require('express'); -var MjpegProxy = require('../mjpeg-proxy').MjpegProxy; +var app = express(); +var HTTP_PORT = 8080; var cam1 = "http://admin:admin@192.168.124.54/cgi/mjpg/mjpg.cgi"; var cam2 = "http://admin:@192.168.124.32/videostream.cgi"; -var app = express(); - app.set("view options", {layout: false}); app.use(express.static(__dirname + '/public')); -app.get('/', function(req, res) { - res.render('index.html'); -}); - app.get('/index1.jpg', new MjpegProxy(cam1).proxyRequest); app.get('/index2.jpg', new MjpegProxy(cam2).proxyRequest); -app.listen(8080) \ No newline at end of file +app.listen(HTTP_PORT); + +console.log("Listening on port "+HTTP_PORT); -- cgit v1.2.1