<commit_before># Mockaroon
Mockaroon: A Simple HTTP Server for Web App development

Made to act and behave exactly like `python -m SimpleHTTPServer`

## Setup

```
brew tap johnlonganecker/mockaroon
brew install mockaroon
```

**Upgrade to latest release**
```
brew upgrade mockaroon
```

## How to Use

Serve static content
```
> mockaroon
Serving HTTP on 0.0.0.0 port 8000 ...
```

Serve static content - specify port
```
> mockaroon 8080
Serving HTTP on 0.0.0.0 port 8080 ...
```

Load configuration from a config file
```
> mockaroon --config config.json
Serving HTTPS on 0.0.0.0 port 8080 ...
Serving static files
adding route /path1
adding route /path2
adding route /path3
```

### How is this different from Python SimpleHTTPServer?

#### Config Files
Currently JSON and YAML config files are supported
```
> mockaroon --config=configfile.(json|yml) [optional port override]
```

#### Fields
**port** `default 8000`<br>
override default port
```
{
  "port": "7896"
}
```

**staticFiles** `default true`<br>
override default of hosting static files
```
{
  "staticFiles": false
}
```

**ssl**<br>

Friendly reminder - to create SSL cert and private key
```
ssh-keygen -f private.key
openssl req -x509 -nodes -days 3065 -newkey rsa:2048 -keyout private.key -out cert.crt
```

If you dont want https omit it
```
{
  ssl: {
    "private": "private.key",
    "cert": "cert.cert"
  }
}
```

**endpoints**<br>
override default port
```
{
  "endpoints": [
    {
      "paths": "",
      "methods": ["", ""],
      "headers": [{
        "Content-Type": "application/json"
      }],
      "body": "response"
    }
  ]
}
```

**proxies**<br>
```
{
  "proxies": [
    {
      "paths": "",
      "destination": ""
    }
  ]
}
```

## TODO
- enable CORS<commit_msg>update proxy portion of readme<commit_after># Mockaroon
Mockaroon: A Simple HTTP Server for Web App development

Made to act and behave exactly like `python -m SimpleHTTPServer`

## Setup

```
brew tap johnlonganecker/mockaroon
brew install mockaroon
```

**Upgrade to latest release**
```
brew upgrade mockaroon
```

## How to Use

Serve static content
```
> mockaroon
Serving HTTP on 0.0.0.0 port 8000 ...
```

Serve static content - specify port
```
> mockaroon 8080
Serving HTTP on 0.0.0.0 port 8080 ...
```

Load configuration from a config file
```
> mockaroon --config config.json
Serving HTTPS on 0.0.0.0 port 8080 ...
Serving static files
adding route /path1
adding route /path2
adding route /path3
```

### How is this different from Python SimpleHTTPServer?

#### Config Files
Currently JSON and YAML config files are supported
```
> mockaroon --config=configfile.(json|yml) [optional port override]
```

#### Fields
**port** `default 8000`<br>
override default port
```
{
  "port": "7896"
}
```

**staticFiles** `default true`<br>
override default of hosting static files
```
{
  "staticFiles": false
}
```

**ssl**<br>

Friendly reminder - to create SSL cert and private key
```
ssh-keygen -f private.key
openssl req -x509 -nodes -days 3065 -newkey rsa:2048 -keyout private.key -out cert.crt
```

If you dont want https omit it
```
{
  ssl: {
    "private": "private.key",
    "cert": "cert.cert"
  }
}
```

**endpoints**<br>
override default port
```
{
  "endpoints": [
    {
      "paths": "",
      "methods": ["", ""],
      "headers": [{
        "Content-Type": "application/json"
      }],
      "body": "response"
    }
  ]
}
```

**proxies**<br>
```
{
  "proxies": [
    {
      "paths": ["/users/{.*}"],
      "destination": "https://somehost:1337"
    }
  ]
}
```

## TODO
- enable CORS
{'fraction_non_alphanumeric': 0.1631623212783852, 'fraction_numerical': 0.02915615363050182, 'mean_word_length': 3.3300970873786406, 'pattern_counts': {'":': 26, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '152256', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1213, 'n_words': 377}