You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/12/14 09:14:16 UTC
[GitHub] [couchdb-nano] glynnbird commented on issue #240: requestDefaults behavior has changed in 9.0.x
glynnbird commented on issue #240:
URL: https://github.com/apache/couchdb-nano/issues/240#issuecomment-744298413
As version 9.x of Nano doesn't use the `request` library anymore then the `requestDefaults` configuration is not the same. As it happens, axios & request both accept a "auth" object, so this code does work:
```js
const Nano = require('.')
const nano = Nano({url: 'http://localhost:5984', requestDefaults: { auth: { username: 'MYUSER', password: 'MYPASS'}}})
nano.db.list().then(console.log)
```
so "it doesn't compile" is purely a Typescript thing easily solved by adding to the `requestDefaultsOptions` interface.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org