I'm trying to create a self-hosted app. This app would provide a custom express server with some routes and also provides a CouchDB access using pouchdb-server. I would like the node server to be able to configure the database and create the admin username/password, and then create the roles functions. How can I configure CouchDB from my nodejs app?
I would like to:
- Stop admin party and create an admin with a password. I found that the web client makes a
PUT
request tohttp://localhost:5984/_node/couchdb@localhost/_config/admins/<username>
with password in payload, but I would like to do it using express-pouchdb, so HTTP is not possible - Create users roles I would like to set up several roles
- Set up permissions which roles can update which databases, what databases are readable by who etc...
Please note that I can't do direct http requests to CouchDB, since I'm using pouch-db-express
in my node app to serve the db to the client, and I would like my express app to configure the couchDB instance managed by pouchdb-express