<commit_before># serve
Simple http server for localhost development.

It's like `python -m SimpleHTTPServer`, but with support for gzip and HTTP/2.

## Installation

```bash
go get github.com/rhardih/serve
```

## Usage

If $GOPATH/bin is in your $PATH, simply:


```
$> serve -h

NAME:
   serve - deliver content of current directory via http

USAGE:
   serve [global options] command [command options] [arguments...]
   
VERSION:
   1.0.0
   
COMMANDS:
GLOBAL OPTIONS:
   --gzip, -g		enable gzip encoding
   --port, -p "8080"	specify port for listening
   --logging, -l	enable logging output
   --http2, -2		enable http2, this generates a self signed certificate, if one isn't already present; cert.pem, key.pem
   --help, -h		show help
   --version, -v	print the version
   
```

## Note

Code for generating self-signed certificate for HTTP/2 was taken from example code in `src/crypto/tls/generate_cert.go`, available at [https://golang.org/src/crypto/tls/generate_cert.go](https://golang.org/src/crypto/tls/generate_cert.go).
<commit_msg>Updates README<commit_after># serve
Simple http server for localhost development.

It's like `python -m SimpleHTTPServer`, but with support for gzip and HTTP/2.

## Installation

```bash
go get github.com/rhardih/serve
```

## Usage

If $GOPATH/bin is in your $PATH, simply:


```
$ serve -h
NAME:
   serve - deliver content of current directory via http/https

USAGE:
   serve [global options] command [command options] [arguments...]

VERSION:
   1.1.0

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --gzip, -g              enable gzip encoding (default: false)
   --port value, -p value  specify port for listening (default: 8080)
   --logging, -l           enable logging output (default: false)
   --http2, -2             enable http2, this generates a self signed
                           certificate, if one isn't already present; cert.pem,
                           key.pem (default: false)
   --help, -h              show help (default: false)
   --version, -v           print the version (default: false)
```

## Note

Code for generating self-signed certificate for HTTP/2 was taken from example code in `src/crypto/tls/generate_cert.go`, available at [https://golang.org/src/crypto/tls/generate_cert.go](https://golang.org/src/crypto/tls/generate_cert.go).

{'fraction_non_alphanumeric': 0.11139347734011013, 'fraction_numerical': 0.010165184243964422, 'mean_word_length': 2.897689768976898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, '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': '842304', 'n_tokens_mistral': 756, 'n_tokens_neox': 723, 'n_words': 262}