Skip to content

Commit 449e65e

Browse files
committed
readme
1 parent 0e77ebb commit 449e65e

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed

CHANGES.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Release Notes
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/).
6+
7+
Note: Minor version `0.X.0` update might break the API, It's recommended to pin `stac-fastapi-html` to minor version
8+
9+
## [unreleased]
10+
11+
## [0.1.0] - TBD
12+
13+
- Initial release
14+
15+
[unreleased]: https://github.com/developmentseed/stac-fastapi-html-middleware/compare/0.1.0...HEAD
16+
[0.1.0]: https://github.com/developmentseed/stac-fastapi-html-middleware/compare/e47f870114260acc70ac56c9632d41dbb267a4d0...0.1.0

CONTRIBUTING.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Development - Contributing
2+
3+
Issues and pull requests are more than welcome: https://github.com/developmentseed/stac-fastapi-html-middleware/issues
4+
5+
**dev install**
6+
7+
```bash
8+
git clone https://github.com/developmentseed/stac-fastapi-html-middleware.git
9+
cd stac-fastapi-html-middleware
10+
python -m pip install -e .["dev"]
11+
```
12+
13+
You can then run the tests with the following command:
14+
15+
```sh
16+
python -m pytest --cov stac-fastapi-html --cov-report term-missing --asyncio-mode=strict
17+
```
18+
19+
**pre-commit**
20+
21+
This repo is set to use `pre-commit` to run *isort*, *flake8*, *pydocstring*, *black* ("uncompromising Python code formatter") and mypy when committing new code.
22+
23+
```bash
24+
# Install pre-commit command
25+
$ pip install pre-commit
26+
27+
# Setup pre-commit withing your local environment
28+
$ pre-commit install
29+
```

README.md

+68
Original file line numberDiff line numberDiff line change
@@ -1 +1,69 @@
11
## stac-fastapi HTML middleware
2+
3+
<p align="center">
4+
<img width="500" src="https://github.com/user-attachments/assets/f243a238-5ba7-44da-963a-cd865578c2a5"/>
5+
<p align="center">stac-fastapi middleware to encode responses into HTML documents</p>
6+
</p>
7+
<p align="center">
8+
<a href="https://github.com/developmentseed/stac-fastapi-html-middleware/actions?query=workflow%3ACI" target="_blank">
9+
<img src="https://github.com/developmentseed/stac-fastapi-html-middleware/workflows/CI/badge.svg" alt="Test">
10+
</a>
11+
<a href="https://github.com/developmentseed/stac-fastapi-html-middleware/blob/main/LICENSE" target="_blank">
12+
<img src="https://img.shields.io/github/license/developmentseed/stac-fastapi-html-middleware.svg" alt="License">
13+
</a>
14+
</p>
15+
16+
17+
---
18+
19+
**Documentation**:
20+
21+
**Source Code**: <a href="https://github.com/developmentseed/stac-fastapi-html-middleware" target="_blank">https://github.com/developmentseed/stac-fastapi-html-middleware</a>
22+
23+
---
24+
25+
## Install
26+
27+
```bash
28+
$ git clone https://github.com/developmentseed/stac-fastapi-html-middleware.git
29+
$ cd stac-fastapi-html-middleware
30+
$ python -m pip install -e .
31+
```
32+
33+
## What
34+
35+
The `HTMLRenderMiddleware` is designed to intercept responses from stac-fastapi application (`json` or `geojson`) and to encode it to HTML responses when:
36+
- the user set `f=html` query-parameter
37+
- `Accept: text/html` request's headers is the highest *priority*
38+
39+
## How
40+
41+
```python
42+
from starlette.middleware import Middleware
43+
44+
from stac_fastapi.api.app import StacApi
45+
from stac_fastapi.html.middleware import HTMLRenderMiddleware
46+
47+
api = StacApi(
48+
middlewares=[
49+
Middleware(HTMLRenderMiddleware),
50+
],
51+
)
52+
```
53+
54+
## Contribution & Development
55+
56+
See [CONTRIBUTING.md](https://github.com/developmentseed/stac-fastapi-html-middleware/blob/main/CONTRIBUTING.md)
57+
58+
## License
59+
60+
See [LICENSE](https://github.com/developmentseed/stac-fastapi-html-middleware/blob/main/LICENSE)
61+
62+
## Authors
63+
64+
Created by [Development Seed](<http://developmentseed.org>)
65+
66+
## Changes
67+
68+
See [CHANGES.md](https://github.com/developmentseed/stac-fastapi-html-middleware/blob/main/CHANGES.md).
69+

0 commit comments

Comments
 (0)