Skip to content

Commit

Permalink
added more info to the api end points
Browse files Browse the repository at this point in the history
  • Loading branch information
gjuoun committed Jun 27, 2020
1 parent 5e71154 commit 4ef0ae2
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Note:

#### `POST /api/auth/register`

> allows user to register with `username` and `password`
> allows user to register with `username` and `password`, returns the created user's `id`

Request:

Expand Down Expand Up @@ -202,7 +202,7 @@ content-type: application/json

#### `POST /api/auth/login`

> allows user to login with `username` and `password`
> allows user to login with `username` and `password`, returns user's information with `token` and `refreshToken`


Request:
Expand Down Expand Up @@ -245,7 +245,7 @@ content-type: application/json

#### `POST /api/auth/token`

> returns new JWT`token` by a given `refreshToken`
> generates a new JWT`token` by a given `refreshToken`

Request:

Expand Down Expand Up @@ -336,7 +336,7 @@ interface Image {

#### `DELETE /api/img/delete`

> allows user to delete their image by a given image `id`
> allows authorized user to delete their image by a given image `id`
Notice in the header `Authorization: Bearer <token>` and `token` must be provided.

Expand Down Expand Up @@ -376,7 +376,7 @@ content-type: application/json

#### `GET /api/img/all`

> returns the authorized user's images information in json format
> returns all the image information of the authorized user in json format
Notice in the header `Authorization: Bearer <token>` and `token` must be provided.

Expand Down Expand Up @@ -408,6 +408,16 @@ content-type: application/json
}
```

- `data.images` is the type of `Image[]`, where:

```ts
interface Image {
id: number;
user_id: number;
filename: string;
}
```

## [🔝](#table-of-contents)

#### `GET /:userId/:filename`
Expand Down

0 comments on commit 4ef0ae2

Please sign in to comment.