<commit_before>Ming
====

A Quasi-RESTful Web Service for MongoDB.

Status
------

Just an experiment. It probably won't make you happy. Move along, there is nothing to see here.

Installation
------------

- Clone it
- Run `npm install`
- Run `node server.js` (see Usage)

Usage
-----

- `port`: Server port
- `mongodb-host`: MongoDB host
- `mongodb-port`: MongoDB port
- `mongodb-database`: MongoDB database

Examples
--------

### Read

    xhr = new XMLHttpRequest();
    xhr.open("GET", "http://localhost:1337/test/519a9b237f837c9ea78155de");
    xhr.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
    xhr.send(null);

### Create

    payload = {
        name: "Ming"
    };
    xhr = new XMLHttpRequest();
    xhr.open("POST", "http://localhost:1337/test");
    xhr.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
    xhr.setRequestHeader("Content-Type", "application/json");<commit_msg>Make clear that an SSL-enabled proxy is mandatory.<commit_after>Ming
====

A Quasi-RESTful Web Service for MongoDB.

Status
------

Just an experiment. It probably won't make you happy. Move along, there is nothing to see here.

Installation
------------

- Clone it
- Run `npm install`
- Run `node server.js` (see Usage)
- Put an SSL-enabled proxy in front of it

Usage
-----

- `port`: Server port
- `mongodb-host`: MongoDB host
- `mongodb-port`: MongoDB port
- `mongodb-database`: MongoDB database

Examples
--------

### Read

    xhr = new XMLHttpRequest();
    xhr.open("GET", "http://localhost:1337/test/519a9b237f837c9ea78155de");
    xhr.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
    xhr.send(null);

### Create

    payload = {
        name: "Ming"
    };
    xhr = new XMLHttpRequest();
    xhr.open("POST", "http://localhost:1337/test");
    xhr.setRequestHeader("Authorization", "Basic " + btoa("username:password"));
    xhr.setRequestHeader("Content-Type", "application/json");
{'fraction_non_alphanumeric': 0.17386883579054396, 'fraction_numerical': 0.02440264361972547, 'mean_word_length': 3.3063457330415753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '995860', 'n_tokens_mistral': 698, 'n_tokens_neox': 641, 'n_words': 162}