/mango-v2

The simple database.

Primary LanguageJavaScript

Mango User Documentation

MangoDB, the simple database.

Installation Guide:

Just clone the GitHub repo or download it from here.

git clone https://github.com/webdevsint/mango-v2.git

Extract the zip if you downloaded it. Navigate to the directory. Open up a terminal and type the following command:

npm install --save

Lastly you need to set some environment variables or secrets in the "./.env" file we provided. You can find it in the root of your installation folder. Open it in any text editor an populate the empty fields. eg.

API_KEY=secret
KEY=encryption_key

And done!

Note: Please don't change the "KEY" secret if you have any documents. Doing so will render those documents undecryptable without the original key.

Creating New Documents:

Open up a terminal in the root directory and and type the following command:

npm run new

Deleting Documents:

Open up a terminal in the root directory and and type the following command:

npm run delete <document-name>

Starting the API server:

Navigate to your your installation folder. Open up a terminal and and type the following command:

npm run start

Your database's API should serve on http://localhost:3000.

URL structure of the database (example): http://localhost:3000/document/test?key=secret

Accessing Documents:

image

Adding and Deleting Entries:

To add a new entry document entry just send a POST request with an object in the body containing your entry. eg.

image

Endpoint used here: http://localhost:3000/document/test?key=secret POST

Similarly, to delete document entries just send a DELETE request with an additional query parameter "index" with the index of the entry you want to delete from the document. eg.

image

Endpoint used here: http://localhost:3000/document/test?key=secret&index=0 DELETE

We used reqbin in our examples to send requests to the API.