Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
- fix docs
- provide multiple examples
  • Loading branch information
devkral committed Nov 28, 2024
1 parent fcbeb5a commit 0686300
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/en/docs/configurations/staticfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ but also via settings.

This will make sure you keep the settings clean, separated and without a bloated **Esmerald** instance.


## Multiple directories and multiple pathes

You have e.g. a node_modules directory you have to include? You can do so by passing multiple `StaticFilesConfig` configurations.
Imagine, for example, you have multiple directories you would like to access including a `node_modules/` one.
This is possible do do it by passing multiple `StaticFilesConfig` configurations and shown below:

```python
{!> ../../../docs_src/configurations/staticfiles/example_multiple.py!}
Expand Down
5 changes: 4 additions & 1 deletion esmerald/config/static_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ class StaticFilesConfig(BaseModel):
path="/static", directory=Path("static")
)
app = Esmerald(static_files_config=[static_files_config])
app = Esmerald(static_files_config=static_files_config)
# or multiple in descending priority
app = Esmerald(static_files_config=[static_files_config1, static_files_config2, ...])
```
"""

Expand Down

0 comments on commit 0686300

Please sign in to comment.