pouchdb/couchdb-fauxton — pull request #5 by MichaelJCole (2014-11-08 21:32:37+00:00)
Title: Custompath

Hi, this PR takes @thesli's comments and suggestions and packages them into a PR.

You can test this PR like this:

1) Clone couchdb-fauxton
2) `grunt release` to build the changes.
3) put together a test server:

package.json
```
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "test.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.9.8",
"express-pouchdb": "^0.7.1",
"morgan": "^1.4.0",
"pouchdb": "^3.0.6"
}
}
```

Test.js
```
var express = require('express')
, app = express()
, PouchDB = require('pouchdb')
, logger = require('morgan')
;

app.use(logger("tiny"));
app.get('/', function(req, res, next) {
res.send('Welcome Traveler! Fauxton?');
});
app.use('/custom', require('express-pouchdb')(PouchDB));

app.listen(3000);
```

To run the server with new Fauxton (assuming test and couchdb-fauxton are in same dir)
```
npm install
cd node_modules/express-pouchdb
mv fauxton fauxton.old
ln -s ../../../couchdb-fauxton/dist/release fauxton
node test.js
```

This addresses several issues identified and a couple extra. From my testing, these issues remain, but none of them are show stoppers. Compared to not working, 90% working is much better!

- Databases -> Any DB -> Compact & Clean -> Cleanup Views -> "Error: missing" -> POST /custom//newdatabase/_view_cleanup 404
- Databases -> Any DB -> All Design Docs -> Add Doc -> Hmmm... Adds regular doc.
- Create Design Doc through Gear -> New View -> Design Doc Metadata

- Url's have format like: GET /custom//_users -> double // isn't awesome.
- API URL -> wrong url http://localhost:3000/newdatabase2/_all_docs should include custom path. http://localhost:3000/custom/newdatabase2/_all_docs