Skip to content

Commit

Permalink
Language review of the README.md (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmitoraj authored and hudymi committed Sep 6, 2019
1 parent 4762d76 commit f2041b3
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://github.com/michal-hudy/mockice/workflows/build/badge.svg)](https://github.com/michal-hudy/mockice/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/michal-hudy/mockice/actions)](https://goreportcard.com/report/github.com/michal-hudy/mockice/actions)

Mockice is a simple HTTP service that provides configurable endpoints. It can be used for testing or serving a static content.
Mockice is a simple HTTP service that provides configurable endpoints. Use it for testing or serving static content.

## Installation

Expand All @@ -15,50 +15,46 @@ go get -u -v github.com/michal-hudy/mockice

## Usage

### Run latest version
To use Mockice, you can run its latest version, run its latest Docker image, or run it from sources. In each case, by default, the service listens on port `8080` and has one endpoint - `http://localhost:8080/hello`.

To run latest version, install a Mockice with command from [Installation](#Installation) section and run:
### Run the latest version

To run Mockice latest version, install Mockice with the command from the [Installation](#Installation) section and run:

```bash
mockice --verbose
```

The service listens on port `8080` and has one endpoint `http://localhost:8080/hello`

### Run a Docker image

To run Mockice latest Docker image, run:
To run Mockice latest Docker image, use the following command:

```bash
docker run -p 8080:8080 hudymi/mockice:latest --verbose
```

The service listens on port `8080` and has one endpoint `http://localhost:8080/hello`

### Run from sources

To run Mockice from sources, run:
To run Mockice from sources, use the following command:

```bash
GO111MODULE=on go run main.go --verbose
```

The service listens on port `8080` and has one endpoint `http://localhost:8080/hello`
```

### Command line parameters

You can use the following parameters:
The table contains the command line parameters available for the service:

| Name | Description | Default Value |
| ---- | ----------- | ------------- |
| `--config` | Path to the configuration file. If not provided the default configuration will be used. | |
| `--verbose` | Enable verbose logging | `false` |
| `--config` | A path to the configuration file. If not provided, the default configuration is used. | |
| `--verbose` | Enables verbose logging. | `false` |

## Configuration

By default Mockice listens on every interfaces on port `8080` and has one endpoint `http://localhost:8080/hello`. If configuration is provided then default endpoint is disabled.
By default, in every interface Mockice listens on port `8080` and has one endpoint - `http://localhost:8080/hello`. If you provide any configuration, the default endpoint is disabled.

Configuration file must be in `yaml` format and for up-to-date list of available fields see [config](main.go) structure.
The configuration file must be in the `yaml` format. See the [config](main.go) structure for the up-to-date list of the available fields.

### File structure

Expand All @@ -73,10 +69,10 @@ endpoints:
- GET
- POST
# Default HTTP response code, if not provided 200
defaultResponseCode: 200
defaultResponseCode: 200
# Default response content
defaultResponseContent: "# Sample service"
# Default response content-type, if not provided "text/plain; charset=utf-8"
defaultResponseContentType: text/plain; charset=utf-8

```
```

0 comments on commit f2041b3

Please sign in to comment.