You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2013/04/25 21:58:11 UTC
git commit: updated refs/heads/master to 86cda7b
Updated Branches:
refs/heads/master a0fc1c608 -> 86cda7b37
Allow external CouchDB servers for Fauxton proxy
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/86cda7b3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/86cda7b3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/86cda7b3
Branch: refs/heads/master
Commit: 86cda7b37f5d2a8d5cd2a2022333c06d71ffb4de
Parents: a0fc1c6
Author: Russell Branca <ch...@gmail.com>
Authored: Thu Apr 25 12:57:49 2013 -0700
Committer: Russell Branca <ch...@gmail.com>
Committed: Thu Apr 25 12:58:05 2013 -0700
----------------------------------------------------------------------
src/fauxton/Gruntfile.js | 11 ++++++++---
src/fauxton/tasks/couchserver.js | 16 ++++++++--------
2 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/86cda7b3/src/fauxton/Gruntfile.js
----------------------------------------------------------------------
diff --git a/src/fauxton/Gruntfile.js b/src/fauxton/Gruntfile.js
index 814279a..b76ae24 100644
--- a/src/fauxton/Gruntfile.js
+++ b/src/fauxton/Gruntfile.js
@@ -194,9 +194,14 @@ module.exports = function(grunt) {
dist: './dist/debug/',
port: 8000,
proxy: {
- host: 'localhost',
- port: 5984,
- https: false
+ target: {
+ host: 'localhost',
+ port: 5984,
+ https: false
+ },
+ // This sets the Host header in the proxy so that you can use external
+ // CouchDB instances and not have the Host set to 'localhost'
+ changeOrigin: true
}
},
http://git-wip-us.apache.org/repos/asf/couchdb/blob/86cda7b3/src/fauxton/tasks/couchserver.js
----------------------------------------------------------------------
diff --git a/src/fauxton/tasks/couchserver.js b/src/fauxton/tasks/couchserver.js
index a3f620f..576893b 100644
--- a/src/fauxton/tasks/couchserver.js
+++ b/src/fauxton/tasks/couchserver.js
@@ -26,11 +26,13 @@ module.exports = function (grunt) {
var port = options.port || 8000;
// Proxy options with default localhost
- var proxy_target = options.proxy || {
- host: 'localhost',
- port: 5984,
- https: false
- };
+ var proxy_settings = options.proxy || {
+ target: {
+ host: 'localhost',
+ port: 5984,
+ https: false
+ }
+ };
// inform grunt that this task is async
var done = this.async();
@@ -46,9 +48,7 @@ module.exports = function (grunt) {
});
// create proxy to couch for all couch requests
- var proxy = new httpProxy.HttpProxy({
- target: proxy_target
- });
+ var proxy = new httpProxy.HttpProxy(proxy_settings);
app.all('*', function (req, res) {
proxy.proxyRequest(req, res);