<commit_before>title: http4k Nanoservices
description: Recipes useful http4k applications you can fit in a tweet

http4k is a small library with minimal dependencies, but what you can accomplish with just a single line of code is quite remarkable due to a combination of the available modules and the`Server as a Function` concept. The following applications all fit in a tweet.

### Simple Proxy [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt"></script>

### Latency Reporting Proxy [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_reporting_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_reporting_proxy.kt"></script>

### Traffic Recording Proxy & replay client [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/record_and_replay_http_traffic_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/record_and_replay_http_traffic_proxy.kt"></script>

### Static file Server [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/static_file_server.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/static_file_server.kt"></script>

### Wire-sniffing Proxy [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt"></script>

### Websocket Clock [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/traffic_sniffing_proxy.kt)
Requires: `http4k-core`, `http4k-server-jetty`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/traffic_sniffing_proxy.kt"></script>

### Chaos Proxy (random latency edition) [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_injection_proxy.kt)
Requires: `http4k-core`, `http4k-testing-chaos`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_injection_proxy.kt"></script><commit_msg>nanoservices examples<commit_after>title: http4k Nanoservices
description: Recipes useful http4k applications you can fit in a tweet

http4k is a small library with minimal dependencies, but what you can accomplish with just a single line of code is quite remarkable due to a combination of the available modules and the`Server as a Function` concept. 

The following applications all fit in a tweet (140 characters)... exports excluded ;)

### Simple Proxy [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt"></script>

### Latency Reporting Proxy [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_reporting_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_reporting_proxy.kt"></script>

### Traffic Recording Proxy & Replayer [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/record_and_replay_http_traffic_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/record_and_replay_http_traffic_proxy.kt"></script>

### Static file Server [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/static_file_server.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/static_file_server.kt"></script>

### Wire-sniffing Proxy [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt)
Requires: `http4k-core`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/simple_proxy.kt"></script>

### Websocket Clock [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/traffic_sniffing_proxy.kt)
Requires: `http4k-core`, `http4k-server-jetty`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/traffic_sniffing_proxy.kt"></script>

### Chaos Proxy (random latency edition) [<img class="octocat" src="/img/octocat-32.png"/>](https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_injection_proxy.kt)
Requires: `http4k-core`, `http4k-testing-chaos`
<script src="https://gist-it.appspot.com/https://github.com/http4k/http4k/blob/master/src/docs/cookbook/nanoservices/latency_injection_proxy.kt"></script>
{'fraction_non_alphanumeric': 0.1669471558397846, 'fraction_numerical': 0.018680578929653316, 'mean_word_length': 5.878472222222222, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 42, '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': '4138830', 'n_tokens_mistral': 2187, 'n_tokens_neox': 2159, 'n_words': 267}