Adding support for fauxton behind a rewrite in a couchapp

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

Branch: refs/heads/fauxton-rebase
Commit: ea162f90e7deba00230c9f6354cd41dc7b2c4fb7
Parents: d3c39b4
Author: Ryan Ramage <[email protected]>
Authored: Mon Feb 25 15:32:56 2013 -0700
Committer: Russell Branca <[email protected]>
Committed: Fri Mar 15 14:35:40 2013 -0700

----------------------------------------------------------------------
 src/fauxton/assets/index.underscore |    2 ++
 src/fauxton/couchapp.js             |   11 +++++++++--
 src/fauxton/grunt.js                |    4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ea162f90/src/fauxton/assets/index.underscore
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/index.underscore 
b/src/fauxton/assets/index.underscore
index 1179ffb..8a62006 100644
--- a/src/fauxton/assets/index.underscore
+++ b/src/fauxton/assets/index.underscore
@@ -30,7 +30,9 @@
     padding-bottom: 40px;
     }
   </style>
+  <% if (base) { %>
   <base href="<%= base %>"></base>
+  <% } %>
 </head>
 
 <body id="home">

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ea162f90/src/fauxton/couchapp.js
----------------------------------------------------------------------
diff --git a/src/fauxton/couchapp.js b/src/fauxton/couchapp.js
index 95d75b3..4711ae2 100644
--- a/src/fauxton/couchapp.js
+++ b/src/fauxton/couchapp.js
@@ -1,10 +1,17 @@
-var couchapp = require('couchapp'), 
+var couchapp = require('couchapp'),
     path = require('path'),
     ddoc;
 
 ddoc = {
   _id: '_design/fauxton',
-  rewrites: {},
+  rewrites: [
+    { "from": "_db" ,    "to"  : "../.." },
+    { "from": "_db/*" ,  "to"  : "../../*" },
+    { "from": "_ddoc" ,  "to"  : "" },
+    { "from": "_ddoc/*", "to"  : "*"},
+    {from: '/', to: 'index.html'},
+    {from: '/*', to: '*'}
+  ],
   views: {},
   shows: {},
   lists: {},

http://git-wip-us.apache.org/repos/asf/couchdb/blob/ea162f90/src/fauxton/grunt.js
----------------------------------------------------------------------
diff --git a/src/fauxton/grunt.js b/src/fauxton/grunt.js
index 33ec8ad..8abdd02 100644
--- a/src/fauxton/grunt.js
+++ b/src/fauxton/grunt.js
@@ -160,9 +160,9 @@ module.exports = function(grunt) {
         src: 'assets/index.underscore',
         dest: 'dist/debug/index.html',
         variables: {
-          assets_root: '/fauxton/_design/fauxton/',
+          assets_root: './',
           requirejs: 'require.js',
-          base: '/fauxton/_design/fauxton/index.html'
+          base: null
         }
       }
     },

Reply via email to