summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Ramage <ryan.ramage@gmail.com>2013-02-25 15:32:56 -0700
committerRyan Ramage <ryan.ramage@gmail.com>2013-02-25 15:36:49 -0700
commitf3300bbde51ac6c9d12d4cb83d67eef27c6fdeb5 (patch)
tree9b281cc9180b63fc5b5a1330dccf7997f559de42
parent66286e9a4688200d67091e0fbbe56957b5833a10 (diff)
downloadcouchdb-f3300bbde51ac6c9d12d4cb83d67eef27c6fdeb5.tar.gz
Adding support for fauxton behind a rewrite in a couchapp
-rw-r--r--src/fauxton/assets/index.underscore2
-rw-r--r--src/fauxton/couchapp.js11
-rw-r--r--src/fauxton/grunt.js4
3 files changed, 13 insertions, 4 deletions
diff --git a/src/fauxton/assets/index.underscore b/src/fauxton/assets/index.underscore
index 1179ffbc0..8a620062b 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">
diff --git a/src/fauxton/couchapp.js b/src/fauxton/couchapp.js
index 95d75b3c7..4711ae242 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: {},
diff --git a/src/fauxton/grunt.js b/src/fauxton/grunt.js
index 9dc7ddb51..927f506d0 100644
--- a/src/fauxton/grunt.js
+++ b/src/fauxton/grunt.js
@@ -159,9 +159,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
}
}
},