diff --git a/README.md b/README.md index e59eda9..b66e516 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ That's right, CouchDB is more than a database: it's also a RESTful web server wi And best of all, CouchDB does it with good ol'-fashioned HTTP. Just open up the network tab and watch the JSON fly back and forth. -To get started, just install CouchDB, throw in [a little SSL](https://wiki.apache.org/couchdb/How_to_enable_SSL), and you've got everything you need for your site's authentication. +To get started, just install CouchDB, throw in [a little SSL](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=48203146), and you've got everything you need for your site's authentication. ### Project status diff --git a/docs/api.md b/docs/api.md index 4314e59..f2ba8b6 100644 --- a/docs/api.md +++ b/docs/api.md @@ -16,9 +16,9 @@ API Like PouchDB, every function takes a Node-style callback of the form `function(error, response)`. Or you can use promises: ```js -db.doSomething(args).then(function (response){ +db.doSomething(args).then(function (response) { return db.doSomethingElse(args); -}).then(function response) { +}).then(function (response) { // handle response }).catch(function (error) { // handle error @@ -77,7 +77,7 @@ db.signUp('robin', 'dickgrayson', { Note that CouchDB does not enforce a password policy or a username policy, unless you add a security doc to the `_users` database. -#### db.logIn(username, password [, options] [ callback]) +#### db.logIn(username, password [, options] [, callback]) Log in an existing user. Throws an error if the user doesn't exist yet, the password is wrong, the HTTP server is unreachable, or a meteor struck your computer. @@ -119,7 +119,7 @@ db.logOut(function (err, response) { {"ok":true} ``` -#### db.getSession([opts] [, callback]) +#### db.getSession([options] [, callback]) Returns information about the current session. In other words, this tells you which user is currently logged in. @@ -157,7 +157,7 @@ db.getSession(function (err, response) { **Note:** `getSession()` returns basic user information, like name and roles, but doesn't return metadata. If you need the metadata, use `getUser()`. -#### db.getUser(username [, opts][, callback]) +#### db.getUser(username [, options] [, callback]) Returns the user document associated with a username. (CouchDB, in a pleasing show of consistency, stores users as JSON documents in the special `_users` database.) This is the primary way to get metadata about a user. @@ -196,7 +196,7 @@ db.getUser('aquaman', function (err, response) { **Note:** Only server admins or the user themselves can fetch user data. Otherwise you will get a 404 `not_found` error. -#### db.putUser(username, opts [, callback]) +#### db.putUser(username [, options] [, callback]) Update the metadata of a user. @@ -212,7 +212,7 @@ db.putUser('robin', { }); ``` -#### db.deleteUser(username, opts [, callback]) +#### db.deleteUser(username [, options] [, callback]) Delete a user. @@ -222,7 +222,7 @@ db.deleteUser('robin', function (err, response) { }); ``` -#### db.changePassword(username, password [, opts][, callback]) +#### db.changePassword(username, password [, options] [, callback]) Set new `password` for user `username`. @@ -244,12 +244,12 @@ db.changePassword('spiderman', 'will-remember', function(err, response) { // "rev": "2-09310a62dcc7eea42bf3d4f67e8ff8c4" // } } -}) +}); ``` **Note:** Only server admins or the user themselves can change user data. Otherwise you will get a 404 `not_found` error. -#### db.changeUsername(oldUsername, newUsername[, opts][, callback]) +#### db.changeUsername(oldUsername, newUsername [, options] [, callback]) Renames `oldUsername` to `newUsername`. @@ -268,7 +268,7 @@ db.changeUsername('spiderman', 'batman', function(err) { } else { // succeeded } -}) +}); ``` **Note:** Only server admins change a username. Otherwise you will get a 404 `not_found` error. @@ -283,7 +283,7 @@ db.signUpAdmin('batman', 'brucewayne', function (err, response) { }); ``` -#### db.deleteAdmin(username, opts [, callback]) +#### db.deleteAdmin(username [, options] [, callback]) Delete an admin.