<commit_before># REST In Peace 
REST In Peace is a dead simple composable API for testing purposes.

## Motivation

Sometimes, you need an API on a flick of the fingers. There are many reasons for it, like when you want to learn something new, share an idea, work with collaborators and so on. Public APIs are fine but they are often constrained to a set of rules that doesn't exactly fit your needs.

### RIP for the rescue! 

RIP is an experimental tool to help you test apps that depends on an API. It let you easily share RESTful APIs and take advantage of prebuilt resources made by the community!

Want a Todo CRUD? No problem! Maybe some users too? Sure thing! Want to connect'em both? Why not!? RIP can help you achieve these tasks pretty easily.

## Installation

You can install RIP using NPM or Yarn, it's totally up to you.

These examples will install RIP globally.

```
npm install --global rip-server
```

Or

```
yarn global add rip-server
```

Now, run the command `rip` on your terminal. You should see a status message telling you that RIP is running and an URL (`http://localhost:3001` by default). Paste the URL in your browser to check if everything is working fine.

## Usage

Assuming that you installed RIP globally, all you need to do is run the command `rip`.

However, you won't have any Graves configured but we'll get there.

RIP needs some basic configuration to work, as we will see in the section below.

## Configuring RIP

To let RIP knows how to handle your endpoints, you must configure some Graves. The way to setup a grave is by creating a `.riprc` file in the root of your project and specify each grave you want to use.

`.riprc` is a simple JSON file that has only the `graves` directive. It looks a little bit like this:

```json
{
  "graves": [
    "users",
    "todos"
  ]
}
```

In this example, we've setup the `users` and `todos` graves.

By default, RIP creates CRUD graves for each value defined inside the `graves` directive.

## Graves

RIP uses the concept o Graves to address endpoints. In fact, each Grave corresponds to an endpoint in the API.

If you have a `todos` Grave configured, you can access it's endpoints over `http://localhost:30001/todos`.

### Grave types

A Grave has basically three types:

#### CRUD

That's the default behavior when all you configure is the grave name. RIP will turn each grave into several CRUD endpoints.

```json
{
  "graves": [
    "posts"
  ]
}
```

Or, you can write the full syntax for a grave

```json
{
  "graves": [{
    "grave": "posts"
  }]
}
```

You'll now have access to these endpoints

| Verb | URI |Description |
|---|---|---|---|
| `GET` | `/posts` | Retrieve all data stored in `posts` collection.
| `GET` | `/posts/:id` | Retrieve a single entry from the `posts` collection.
| `POST` | `/posts` | Store all data sent in the request body to `posts` collection as a document. Returns the `_id` field generated for the record.<commit_msg>Fixing README<commit_after># REST In Peace 
REST In Peace is a dead simple composable API for testing purposes.

## Motivation

Sometimes, you need an API on a flick of the fingers. There are many reasons for it, like when you want to learn something new, share an idea, work with collaborators and so on. Public APIs are fine but they are often constrained to a set of rules that doesn't exactly fit your needs.

### RIP for the rescue! 

RIP is an experimental tool to help you test apps that depends on an API. It let you easily share RESTful APIs and take advantage of prebuilt resources made by the community!

Want a Todo CRUD? No problem! Maybe some users too? Sure thing! Want to connect'em both? Why not!? RIP can help you achieve these tasks pretty easily.

## Installation

You can install RIP using NPM or Yarn, it's totally up to you.

These examples will install RIP globally.

```
npm install --global rip-server
```

Or

```
yarn global add rip-server
```

Now, run the command `rip` on your terminal. You should see a status message telling you that RIP is running and an URL (`http://localhost:3001` by default). Paste the URL in your browser to check if everything is working fine.

## Usage

Assuming that you installed RIP globally, all you need to do is run the command `rip`.

However, you won't have any Graves configured but we'll get there.

RIP needs some basic configuration to work, as we will see in the section below.

## Configuring RIP

To let RIP knows how to handle your endpoints, you must configure some Graves. The way to setup a grave is by creating a `.riprc` file in the root of your project and specify each grave you want to use.

`.riprc` is a simple JSON file that has only the `graves` directive. It looks a little bit like this:

```json
{
  "graves": [
    "users",
    "todos"
  ]
}
```

In this example, we've setup the `users` and `todos` graves.

By default, RIP creates CRUD graves for each value defined inside the `graves` directive.

## Graves

RIP uses the concept o Graves to address endpoints. In fact, each Grave corresponds to an endpoint in the API.

If you have a `todos` Grave configured, you can access it's endpoints over `http://localhost:30001/todos`.

### Grave types

A Grave has basically three types:

#### CRUD

That's the default behavior when all you configure is the grave name. RIP will turn each grave into several CRUD endpoints.

```json
{
  "graves": [
    "posts"
  ]
}
```

Or, you can write the full syntax for a grave

```json
{
  "graves": [{
    "grave": "posts"
  }]
}
```

You'll now have access to these endpoints

| Verb | URI |Description |
|---|---|---|
| `GET` | `/posts` | Retrieve all data stored in `posts` collection.
| `GET` | `/posts/:id` | Retrieve a single entry from the `posts` collection.
| `POST` | `/posts` | Store all data sent in the request body to `posts` collection as a document. Returns the `_id` field generated for the record.
{'fraction_non_alphanumeric': 0.08288043478260869, 'fraction_numerical': 0.0030570652173913045, 'mean_word_length': 3.6999201915403033, 'pattern_counts': {'":': 8, '<': 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': '2784316', 'n_tokens_mistral': 1762, 'n_tokens_neox': 1639, 'n_words': 938}