From c2131051ffaa16d96f78ecaa733d8787328d9deb Mon Sep 17 00:00:00 2001 From: maxogden Date: Sun, 24 Apr 2011 18:14:59 -0700 Subject: [PATCH] more robust rewrites --- _attachments/pages/index.html | 4 ++-- rewrites.json | 28 ++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/_attachments/pages/index.html b/_attachments/pages/index.html index 800f7221..87207e7f 100644 --- a/_attachments/pages/index.html +++ b/_attachments/pages/index.html @@ -57,7 +57,7 @@ "disk_size": formatDiskSize(dbInfo.disk_size) }); - if( config.vhost ) dbInfo.db_name = 'db'; + if( config.vhost ) dbInfo.db_name = "api"; render( 'db', 'stats', dbInfo ); render( 'bulk', 'bulk', dbInfo ); @@ -72,7 +72,7 @@ } - $.getJSON( config.baseURL + 'db', gotDb ); + $.getJSON( config.baseURL + "api", gotDb ); $( '.csv' ).live('click', ( function( e ) { window.location.href = csvUrl; diff --git a/rewrites.json b/rewrites.json index 71db07a3..69c2b60d 100644 --- a/rewrites.json +++ b/rewrites.json @@ -27,12 +27,24 @@ "to": "_list/urlencode/headers", "from": "headers" }, - { - "to": "../..", - "from": "db" - }, - { - "to": "../../*", - "from": "db/*" - } + { + "to": "./", + "from": "ddoc" + }, + { + "to": "./", + "from": "api/_design/ddoc" + }, + { + "to": "./*", + "from": "api/_design/ddoc/*" + }, + { + "to": "../../", + "from": "api" + }, + { + "to": "../../*", + "from": "api/*" + } ] \ No newline at end of file