Skip to content

Commit

Permalink
updated README sample
Browse files Browse the repository at this point in the history
  • Loading branch information
No9 committed Oct 15, 2014
1 parent c5c36e8 commit 7bb2677
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,40 +49,45 @@ Browse to [localhost:8000](http://localhost:8000) and you should see:
### Code

``` js

var http = require('http'),
connect = require('connect'),
httpProxy = require('http-proxy');


var selects = [];
var simpleselect = {};
var selects = [];
var simpleselect = {};

simpleselect.query = '.b';
simpleselect.func = function (node) {
node.createWriteStream().end('<div>+ Trumpet</div>');
}

selects.push(simpleselect);

//
// Basic Connect App
//
var app = connect();

var proxy = httpProxy.createProxyServer({
target: 'http://localhost:9000'
})

simpleselect.query = '.b';
simpleselect.func = function (node) {
node.createWriteStream().end('<div>+ Trumpet</div>');
}

selects.push(simpleselect);
app.use(require('../')([], selects));

//
// Basic Connect App
//
connect.createServer(
require('harmon')([], selects),
function (req, res) {
proxy.web(req, res);
}
).listen(8000);
app.use(function (req, res) {
proxy.web(req, res);
});

var proxy = httpProxy.createProxyServer({
target: 'http://localhost:9000'
})
http.createServer(app).listen(8000);

http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write('<html><head></head><body><div class="a">Nodejitsu Http Proxy</div><div class="b">&amp; Frames</div></body></html>');
res.end();
}).listen(9000);
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.write('<html><head></head><body><div class="a">Nodejitsu Http Proxy</div><div class="b">&amp; Frames</div></body></html>');
res.end();
}).listen(9000);
```
or
See how images could be rotated.
Expand Down

0 comments on commit 7bb2677

Please sign in to comment.