Skip to content

Commit f883066

Browse files
committed
chore: add markdown lint
1 parent c3bf9b2 commit f883066

File tree

7 files changed

+387
-21
lines changed

7 files changed

+387
-21
lines changed

.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"default": true,
3+
"MD013": {
4+
"line_length": 120
5+
}
6+
}

.markdownlintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CHANGELOG.md

CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ All notable changes to this project will be documented in this file. See [standa
44

55
## 1.4.0 (2022-12-30)
66

7-
87
### Features
98

109
* throw error 400 on image download error ([f9af9c0](https://github.com/MobileTeleSystems/image-optimize/commit/f9af9c04879573dbbf1301e1323ddc7d2059ddd8))
1110
* update packages versions ([11e314e](https://github.com/MobileTeleSystems/image-optimize/commit/11e314ec7a68b3981a37399b621cabac26333a90))
1211

13-
1412
### Bug Fixes
1513

16-
* throw error 404 if image src return 404 ([dc4bf2a](https://github.com/MobileTeleSystems/image-optimize/commit/dc4bf2aea308f88a18b8427004ff0281e55ce0c5))
14+
* throw error 404 if image src return 404 ([dc4bf2a](https://github.com/MobileTeleSystems/image-optimize/commit/dc4bf2aea308f88a18b8427004ff0281e55ce0c5))

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ community include:
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or advances of
31-
any kind
30+
* The use of sexualized language or imagery, and sexual attention or advances
31+
of any kind
3232
* Trolling, insulting or derogatory comments, and personal or political attacks
3333
* Public or private harassment
3434
* Publishing others' private information, such as a physical or email address,

README.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
# Microservice for responsive resize, compression and optimization of images on the fly for web pages
2+
13
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/042786e7f0304d1ea29d83f8c1522a55)](https://www.codacy.com/gh/MobileTeleSystems/image-optimize/dashboard?utm_source=github.com&utm_medium=referral&utm_content=MobileTeleSystems/image-optimize&utm_campaign=Badge_Grade)
2-
[![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/@mts-pjsc/image-optimize
3-
)
44
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
55
[![GitHub license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/MobileTeleSystems/image-optimize/blob/main/LICENSE)
66

7-
# Microservice for responsive resize, compression and optimization of images on the fly for web pages.
8-
9-
Optimizing images helps reduce image weight and increases website loading speed, which is very important for both users and search engines. For these purposes, we have created a microservice that perfectly copes with this task.
7+
Optimizing images helps reduce image weight and increases website loading speed,
8+
which is very important for both users and search engines. For these purposes,
9+
we have created a microservice that perfectly copes with this task.
1010

1111
Features:
1212
- Resize images for the user's screen size,
@@ -18,32 +18,49 @@ Features:
1818
- Supports basic authorization for multiple domains and endpoints,
1919
- Supports security restrictions for allowed addresses.
2020

21-
### Try
21+
## Try
22+
2223
To try the microservice features, run the container with the command:
24+
2325
```sh
2426
docker run -it --rm -p 3000:3000 mtsrus/image-optimize
2527
```
2628

2729
Now you can open the browser and check the work with the command:
30+
2831
```sh
2932
http://localhost:3000/optimize?size=1060&format=webp&src=https://tb.mts.ru/static/landing/images-index2/banner/slider/partners.png
3033
```
3134

32-
By changing the src, size, format parameters, you can choose the path to the image, the final size and the image format.
35+
By changing the src, size, format parameters,
36+
you can choose the path to the image,
37+
the final size and the image format.
3338

3439
### Use
40+
3541
To start the microservice in production, use the command:
42+
3643
```sh
3744
docker run -d --restart always -p 3000:3000 mtsrus/image-optimize
3845
```
3946

4047
### Container parameters
4148

42-
- `-e PORT=3000` - the port on which the microservice will be launched, default 3000.
43-
- `-e ALLOW_SIZES="100,200,1024-1920"` - an array of allowed sizes for the resulting images, default 100-1920. Use specific values to prevent heavy loads on the server.
44-
- `-e ALLOW_SOURCES="https%3A%2F%2Ftb.mts.ru%2F"` - url array of allowed addresses for image sources, default * (any). Use comma as separator. It is recommended to apply encodeURIComponent to url.
45-
- `-e BASIC_AUTHS="https%3A%2F%2Ftb.mts.ru%2F"` - an array of endpoints with basic authorization parameters, default empty. Has format encodeURIComponent("url"):encodeURIComponent("login"):encodeURIComponent("password"). Use comma as separator.
46-
- `-e SHARP_CONCURRENCY=0` - number of threads libvips' should create to process each image, default 0 (will reset to the number of CPU cores).
49+
- `-e PORT=3000` - the port on which the microservice will be launched, default 3000.
50+
- `-e ALLOW_SIZES="100,200,1024-1920"` - an array of allowed sizes for the resulting images,
51+
default 100-1920. Use specific values to prevent heavy loads on the server.
52+
53+
- `-e ALLOW_SOURCES="https%3A%2F%2Ftb.mts.ru%2F"` - url array of allowed addresses for image sources, default * (any).
54+
Use comma as separator. It is recommended to apply encodeURIComponent to url.
55+
56+
- `-e BASIC_AUTHS="https%3A%2F%2Ftb.mts.ru%2F"` - an array of endpoints with basic authorization parameters, default empty.
57+
Has format encodeURIComponent("url"):encodeURIComponent("login"):encodeURIComponent("password"). Use comma as separator.
58+
59+
- `-e SHARP_CONCURRENCY=0` - number of threads libvips' should create to process each image,
60+
default 0 (will reset to the number of CPU cores).
4761

4862
### Components for web
49-
To optimize images in the browser, there is a component for React. You can find it [by following the link](https://github.com/MobileTeleSystems/image-optimize-react). The component itself determines the most suitable image parameters and requests it from this microservice.
63+
64+
To optimize images in the browser, there is a component for React. You can find it
65+
[by following the link](https://github.com/MobileTeleSystems/image-optimize-react).
66+
The component itself determines the most suitable image parameters and requests it from this microservice.

0 commit comments

Comments
 (0)