Skip to content

Commit

Permalink
gendocs
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonOehlman committed Jun 2, 2014
1 parent ad2b946 commit 9a77f7a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,37 @@ async.series([

The above example proxies a request from http://localhost:8080/ngineer through to https://github.com/DamonOehlman/ngineer. A more practical example is shown below where we proxy a local [express](https://github.com/visionmedia/express) application through nginx.

ERROR: could not find:
```js
var async = require('async');
var express = require('express');

var nginx = require('ngineer')(__dirname + '/nginx', {
port: 8080
});
var proxy = nginx.location('/express-test').proxy('http://localhost:3000/');

// create our simple express app
express()
.get('/', function(req, res) {
res.end('Hi there');
})
.listen(3000, function(err) {
if (err) {
return console.error('could not start bind express app to port 3000', err);
}

async.series([ nginx.scaffold, nginx.start, proxy ], function(err) {
if (err) {
return console.error(err);
}

console.log('started nginx, pid: ' + nginx.pid);
console.log('express app available at http://localhost:8080/express-test');
});
});


```


## How it Works
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ The following example shows how the `ngineer` module can be used to scaffold and

The above example proxies a request from http://localhost:8080/ngineer through to https://github.com/DamonOehlman/ngineer. A more practical example is shown below where we proxy a local [express](https://github.com/visionmedia/express) application through nginx.

<<< examples/start.js
<<< examples/proxy-express.js

0 comments on commit 9a77f7a

Please sign in to comment.