Created
February 7, 2014 17:09
-
-
Save rjcorwin/8867155 to your computer and use it in GitHub Desktop.
Combine the CouchDB API with another HTTP API using Node.js http-proxy module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var httpProxy = require('http-proxy') | |
| var options = { | |
| router: { | |
| 'mydomain.com/api': '127.0.0.1:8800', // -> Additional API possibly from an Express App | |
| 'mydomain.com/*': '127.0.0.1:5984', // -> CouchDB binded to the base so it behaves just like a CouchDB | |
| } | |
| } | |
| httpProxy.createServer(options).listen(80) | |
| console.log('httpProxy listening at port 80') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment