Skip to content

Commit

Permalink
updated pipe-file example
Browse files Browse the repository at this point in the history
  • Loading branch information
nrstott committed Jan 9, 2012
1 parent 5ba3a17 commit 6c1a9dc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/pipe-file.js
@@ -1,14 +1,14 @@
var bogart = require('../lib/bogart');
var fs = require('fs');
var path = require('path');
var bogart = require('../lib/bogart')
, fs = require('fs')
, path = require('path');

var app = bogart.router();
var router = bogart.router();

app.get('/', function(req) {
router.get('/', function(req) {
return bogart.html('<html><body><img src="/image.jpg" /></body></html>');
});

app.get('/image.jpg', function(req) {
router.get('/image.jpg', function(req) {
var filePath = path.join(__dirname, 'static-server', 'public', 'images', 'ninja-cat.jpg')
, stat = fs.statSync(filePath);

Expand All @@ -17,10 +17,10 @@ app.get('/image.jpg', function(req) {
});
});

app.get('/cat.jpg', function(req) {
router.get('/cat.jpg', function(req) {
var filePath = path.join(__dirname, 'static-server', 'public', 'images', 'ninja-cat.jpg');

return bogart.file(filePath);
});

bogart.start(app);
bogart.start(router);

0 comments on commit 6c1a9dc

Please sign in to comment.