Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
README.md: add 'Endpoints' section
Browse files Browse the repository at this point in the history
This section contains two more sections: 'Pages' and 'API'
  • Loading branch information
ShoshinNikita committed Jan 23, 2020
1 parent 876e009 commit 7ccfa73
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ You can find more screenshots [here](./docs/images/README.md)
- [Development](#development)
- [Run](#run)
- [Test](#test)
- [API](#api)
- [General](#general)
- [Income](#income)
- [Monthly Payment](#monthly-payment)
- [Spend](#spend)
- [Spend Type](#spend-type)
- [Endpoints](#endpoints)
- [Pages](#pages)
- [API](#api)

## Install

Expand Down Expand Up @@ -79,7 +76,7 @@ You need [Docker](https://docs.docker.com/install/) and [docker-compose](https:/
| Env Var | Default value | Description |
| ------------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DEBUG` | `false` | Is Debug Mode on |
| `LOGGER_MODE` | `prod` | Logger mode. Available options: `prod` (or `production`), `dev` (or `develop`). | **** |
| `LOGGER_MODE` | `prod` | Logger mode. Available options: `prod` (or `production`), `dev` (or `develop`). |
| `LOGGER_LEVEL` | `info` | Min level of log messages. Available options: `debug`, `info`, `warn`, `error`, `fatal`.<br><br>**Note:** level is always `debug` when Debug Mode is on |
| `DB_TYPE` | `postgres` | Database type. Only `postgres` is available now |
| `DB_PG_HOST` | `localhost` | Host for connection to the db |
Expand Down Expand Up @@ -131,13 +128,23 @@ make test
make test-integ
```

## API
## Endpoints

### Pages

You can find screenshots of pages [here](./docs/images/README.md)

- `/overview` - Overview Page (it is not ready yet)
- `/overview/{year}` - Year Page
- `/overview/{year}/{month_number}` - Month Page

### API

All endpoints return json response with `Content-Type: application/json` header.

Requests and responses can be found in [internal/web/models](internal/web/models/models.go) package

### General
#### General

- `GET /api/months` - get month

Expand All @@ -149,7 +156,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.GetDayReq` or `models.GetDayByDate`
**Response:** `models.GetDayResp` or `models.Response`

### Income
#### Income

- `POST /api/incomes` - add a new income

Expand All @@ -166,7 +173,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.RemoveIncomeReq`
**Response:** `models.Response`

### Monthly Payment
#### Monthly Payment

- `POST /api/monthly-payments` - add new Monthly Payment

Expand All @@ -183,7 +190,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.DeleteMonthlyPaymentReq`
**Response:** `models.Response`

### Spend
#### Spend

- `POST /api/spends` - add new Spend

Expand All @@ -200,7 +207,7 @@ Requests and responses can be found in [internal/web/models](internal/web/models
**Request:** `models.RemoveSpendReq`
**Response:** `models.Response`

### Spend Type
#### Spend Type

- `GET /api/spend-types` - get list of all Spend Types

Expand Down

0 comments on commit 7ccfa73

Please sign in to comment.