@@ -46,6 +46,24 @@ With <b>microbootstrap</b>, you get an application with lightweight built-in sup
4646
4747Interested? 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
5169You 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
341359Despite settings being pretty convenient mechanism, it's not always possible to store everything in settings.
0 commit comments