Skip to content

Commit 6a8adf6

Browse files
committed
Add TOC
1 parent 9326643 commit 6a8adf6

File tree

2 files changed

+45
-27
lines changed

2 files changed

+45
-27
lines changed

README.md

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@ With <b>microbootstrap</b>, you get an application with lightweight built-in sup
4646

4747
Interested? Let's jump right into it ⚡
4848

49+
## Table of contents
50+
51+
- [Installation](#installation)
52+
- [Quickstart](#quickstart)
53+
- [Settings](#settings)
54+
- [Service settings](#service-settings)
55+
- [Instruments](#instruments)
56+
- [Sentry](#sentry)
57+
- [Prometheus](#prometheus)
58+
- [Opentelemetry](#opentelemetry)
59+
- [Logging](#logging)
60+
- [Cors](#cors)
61+
- [Swagger](#swagger)
62+
- [Configuration](#configuration)
63+
- [Instruments configuration](#instruments-configuration)
64+
- [Application configuration](#application-configuration)
65+
- [Advanced](#advanced)
66+
4967
## Installation
5068

5169
You can install package with `pip` or `poetry`.
@@ -283,6 +301,32 @@ Parameters description:
283301
- `logging_extra_processors` - set additional structlog processors if you have some.
284302
- `logging_exclude_endpoints` - remove logging on certain endpoints.
285303

304+
### Cors
305+
306+
```python
307+
from microbootstrap.bootstrappers.litestar import BaseBootstrapSettings
308+
309+
310+
class YourSettings(BaseBootstrapSettings):
311+
cors_allowed_origins: list[str] = pydantic.Field(default_factory=list)
312+
cors_allowed_methods: list[str] = pydantic.Field(default_factory=list)
313+
cors_allowed_headers: list[str] = pydantic.Field(default_factory=list)
314+
cors_exposed_headers: list[str] = pydantic.Field(default_factory=list)
315+
cors_allowed_credentials: bool = False
316+
cors_allowed_origin_regex: str | None = None
317+
cors_max_age: int = 600
318+
```
319+
320+
Parameters description:
321+
322+
- `cors_allowed_origins` - list of origins that are allowed.
323+
- `cors_allowed_methods` - list of allowed HTTP methods.
324+
- `cors_allowed_headers` - list of allowed headers.
325+
- `cors_exposed_headers` - list of headers that are exposed via the 'Access-Control-Expose-Headers' header.
326+
- `cors_allowed_credentials` - boolean dictating whether or not to set the 'Access-Control-Allow-Credentials' header.
327+
- `cors_allowed_origin_regex` - regex to match origins against.
328+
- `cors_max_age` - response caching TTL in seconds, defaults to 600.
329+
286330
### Swagger
287331

288332
```python
@@ -310,32 +354,6 @@ Parameters description:
310354
- `swagger_offline_docs` - makes swagger js bundles access offline, because service starts to host via static.
311355
- `swagger_extra_params` - additional params to pass into openapi config.
312356

313-
### Cors
314-
315-
```python
316-
from microbootstrap.bootstrappers.litestar import BaseBootstrapSettings
317-
318-
319-
class YourSettings(BaseBootstrapSettings):
320-
cors_allowed_origins: list[str] = pydantic.Field(default_factory=list)
321-
cors_allowed_methods: list[str] = pydantic.Field(default_factory=list)
322-
cors_allowed_headers: list[str] = pydantic.Field(default_factory=list)
323-
cors_exposed_headers: list[str] = pydantic.Field(default_factory=list)
324-
cors_allowed_credentials: bool = False
325-
cors_allowed_origin_regex: str | None = None
326-
cors_max_age: int = 600
327-
```
328-
329-
Parameters description:
330-
331-
- `cors_allowed_origins` - list of origins that are allowed.
332-
- `cors_allowed_methods` - list of allowed HTTP methods.
333-
- `cors_allowed_headers` - list of allowed headers.
334-
- `cors_exposed_headers` - list of headers that are exposed via the 'Access-Control-Expose-Headers' header.
335-
- `cors_allowed_credentials` - boolean dictating whether or not to set the 'Access-Control-Allow-Credentials' header.
336-
- `cors_allowed_origin_regex` - regex to match origins against.
337-
- `cors_max_age` - response caching TTL in seconds, defaults to 600.
338-
339357
## Configuration
340358

341359
Despite settings being pretty convenient mechanism, it's not always possible to store everything in settings.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
"Programming Language :: Python :: 3.11",
2727
"Programming Language :: Python :: 3.12",
2828
]
29-
version = "0.1.0"
29+
version = "0.2.1"
3030
description = "Package for bootstrapping new micro-services"
3131
authors = ["community-of-python"]
3232
readme = "README.md"

0 commit comments

Comments
 (0)