summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorbignerd95 <lorenzo.santina@gmail.com>2013-06-28 11:15:38 +0200
committerbignerd95 <lorenzo.santina@gmail.com>2013-06-28 11:15:38 +0200
commitda9099460799fd51035836e120ac99d707a83bde (patch)
tree0673e98469d82e6959516af26a67f0c30eeab19c /example
parent83cf5017179c4ce3ba150ab7551bad57946825ee (diff)
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
Diffstat (limited to 'example')
-rw-r--r--example/express-app.js14
1 files changed, 6 insertions, 8 deletions
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);