Skip to content

Commit 1540fbc

Browse files
authored
Merge pull request #27 from cristianmusic7/master
CouchDB setup documentation added.
2 parents 2ccf3f0 + b15f193 commit 1540fbc

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README_Notebook.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,40 @@ The notebook should work as a standalone plugin, you just need to put the folder
3535

3636
The Old API was used due to the documentation was more thorought.
3737

38-
#How to use it:
38+
## How to use it:
3939
Click on the create menu button at the left top corner of the creen and create a notebook object.
4040
After you saved it you can start to create new entries, either clicking inside of the drag area or dragging an especific object to a new entry or an entry already created.
4141

4242
Once you have created the snapshot of the object, you can make annotations over it. Also you can create whichever snapshots per entry as you consider,
4343

44+
## CouchDB Persistence storage
45+
46+
Open MCT is packaged along with a few general-purpose plugins among them the CouchDB plugin:
47+
48+
* `openmct.plugins.CouchDB` is an adapter for using CouchDB for persistence
49+
of user-created objects. This is a constructor that takes the URL for the
50+
CouchDB database as a parameter, e.g.
51+
```javascript
52+
openmct.install(openmct.plugins.CouchDB('url-to-your-CouchDB-database'))
53+
```
54+
You can install and host your DB or use services like cloudant https://www.ibm.com/cloud/cloudant.com
55+
56+
To manage the DB you can use tools like Fauxton: http://couchdb.apache.org/fauxton-visual-guide/, it commonly comes bundled with CouchDB installation.
57+
58+
To avoid Cross-Origin Resource Sharing (CORS) on remote servers connections please config your CORS settings and add your domain. For instance on Cloudant:
59+
60+
![cors1](https://user-images.githubusercontent.com/18453600/32687056-667b3fc6-c681-11e7-8cd5-39e000dd816c.png)
61+
62+
You have to create a database for the app and then create an user or API Key to grant database permissions for writing/reading it.
63+
64+
![cors2](https://user-images.githubusercontent.com/18453600/32687060-96725142-c681-11e7-96fe-b9d298ad294c.png)
65+
66+
If you have the LocalStorage plugin enabled remove its call from index.html and replace it for the CouchDB plugin.
67+
68+
After that copy the url of your DB and paste it as an argument of the CouchDB plugin call:
69+
```javascript
70+
openmct.install(openmct.plugins.CouchDB('CouchDB-host/database-name'))
71+
```
72+
73+
Any config issue you can refer to CouchDB docs http://docs.couchdb.org/en/2.1.1/.
74+

0 commit comments

Comments
 (0)