From fa8391b390d3bb1520018231b85f4b1d37c4817c Mon Sep 17 00:00:00 2001 From: Joseph Paul Date: Wed, 2 Oct 2024 22:42:42 +0200 Subject: [PATCH] Document HTTP API endpoints in README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 66bafd3..23fd5c3 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,14 @@ Templates and schemas are plain text files and therefore easily manageable. The The web service can be run as a simple go binary or as a [docker image](https://hub.docker.com/r/sehrgutesoftware/httpdf). +### API + +#### `POST /templates/{template}/render` +Render the template using the JSON-encoded data provided in the request body. Successful response is of `Content-Type: application/pdf`. + +#### `GET /templates/{template}/preview` +Render an HTML preview of the template using data from the template's `example.json` file. Useful for template development. + ### Creating Templates > Check the [templates/example](./templates/example/) directory for an example template.