knative-function/README.md

30 lines
862 B
Markdown
Raw Permalink Normal View History

2023-12-08 15:24:52 +00:00
# Python HTTP Function
2023-12-08 09:25:41 +00:00
2023-12-08 15:24:52 +00:00
Welcome to your new Python function project! The boilerplate function
code can be found in [`func.py`](./func.py). This function will respond
to incoming HTTP GET and POST requests.
2023-12-08 09:25:41 +00:00
2023-12-08 15:24:52 +00:00
## Endpoints
2023-12-08 09:25:41 +00:00
2023-12-08 15:24:52 +00:00
Running this function will expose three endpoints.
2023-12-08 09:25:41 +00:00
2023-12-08 15:24:52 +00:00
* `/` The endpoint for your function.
* `/health/readiness` The endpoint for a readiness health check
* `/health/liveness` The endpoint for a liveness health check
2023-12-08 09:25:41 +00:00
2023-12-08 15:24:52 +00:00
The health checks can be accessed in your browser at
[http://localhost:8080/health/readiness]() and
[http://localhost:8080/health/liveness]().
You can use `func invoke` to send an HTTP request to the function endpoint.
2023-12-08 09:25:41 +00:00
2023-12-08 15:24:52 +00:00
## Testing
2023-12-08 09:25:41 +00:00
2023-12-08 15:24:52 +00:00
This function project includes a [unit test](./test_func.py). Update this
as you add business logic to your function in order to test its behavior.
```console
python test_func.py
```