You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/12 07:20:14 UTC

[20/52] [abbrv] fauxton commit: updated refs/heads/import-master to d11b90b

made couchserver configurable via settings.json


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/60561d66
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/60561d66
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/60561d66

Branch: refs/heads/import-master
Commit: 60561d663d1b4727e193d459d23aadbf1a9d79bb
Parents: ae05109
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Tue Jan 14 14:27:27 2014 -0500
Committer: Garren Smith <ga...@gmail.com>
Committed: Wed Jan 15 09:01:19 2014 +0200

----------------------------------------------------------------------
 Gruntfile.js | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/60561d66/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index 49b52a4..cf70440 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -112,6 +112,28 @@ module.exports = function(grunt) {
     return settings.template || defaultSettings;
   }();
 
+  var couchserver_config  = function () {
+    // add a "couchserver" key to settings.json with JSON that matches the
+    // keys and values below (plus your customizations) to have Fauxton work
+    // against a remote CouchDB-compatible server.
+    var defaults = {
+      dist: './dist/debug/',
+      port: 8000,
+      proxy: {
+        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
+      }
+    };
+
+    return helper.readSettingsFile().couchserver || defaults;
+  }();
+
   grunt.initConfig({
 
     // The clean task ensures all files are removed from the dist/ directory so
@@ -223,20 +245,7 @@ module.exports = function(grunt) {
     },
 
     // Runs a proxy server for easier development, no need to keep deploying to couchdb
-    couchserver: {
-      dist: './dist/debug/',
-      port: 8000,
-      proxy: {
-        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
-      }
-    },
+    couchserver: couchserver_config,
 
     watch: {
       js: {