You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This middleware will also intercept the openapi document from stac-fastapi application to enhance the schemas by adding `f=html` query-parameter and `Accept: text/html` available headers.
64
+
65
+
<imgwidth="800"alt="Screenshot 2025-03-25 at 3 16 44 PM"src="https://github.com/user-attachments/assets/07b53933-fbfd-4ba1-b654-6f2d72a2334b" />
66
+
39
67
## How
40
68
41
69
```python
@@ -51,6 +79,32 @@ api = StacApi(
51
79
)
52
80
```
53
81
82
+
:warning: You should place the `HTMLRenderMiddleware` before any `compression` middleware in the `middlewares` stack
83
+
84
+
```python
85
+
# NOK
86
+
api = StacApi(
87
+
...
88
+
middlewares=[
89
+
Middleware(BrotliMiddleware),
90
+
Middleware(HTMLRenderMiddleware),
91
+
],
92
+
)
93
+
# OK
94
+
api = StacApi(
95
+
...
96
+
middlewares=[
97
+
Middleware(HTMLRenderMiddleware), # <-- Put the HTML Render middleware before the compression middleware
98
+
Middleware(BrotliMiddleware),
99
+
],
100
+
)
101
+
```
102
+
103
+
## HTML documents
104
+
105
+
See [docs/pages.md](docs/pages.md) for HTML preview
106
+
107
+
54
108
## Contribution & Development
55
109
56
110
See [CONTRIBUTING.md](https://github.com/developmentseed/stac-fastapi-html-middleware/blob/main/CONTRIBUTING.md)
0 commit comments