From 2faebcd5b449c9ae849d665b635694d6a85a5f7b Mon Sep 17 00:00:00 2001 From: Tom Wright Date: Sun, 9 Aug 2020 11:04:33 +0100 Subject: [PATCH] Update readme --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 50b0cfe..4ad4bfa 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,11 @@ Start the HTTP server: go run cmd/app/main.go --mermaid=./mermaidcli/node_modules/.bin/mmdc --in=./in --out=./out ``` -Send CURL request to generate a diagram via `POST`: +### Diagram creation + +#### POST + +Send a CURL request to generate a diagram via `POST`: ``` curl --location --request POST 'http://localhost:80/generate' \ --header 'Content-Type: text/plain' \ @@ -33,9 +37,16 @@ curl --location --request POST 'http://localhost:80/generate' \ ' ``` -Or send CURL request to generate a diagram via `GET`... send in url encoded data under the `data` query param: +#### GET + +Send a CURL request to generate a diagram via `GET`... send in url encoded data under the `data` query param: ``` curl --location --request GET 'http://localhost:80/generate?data=graph%20LR%0A%0A%20%20%20%20A--%3EB%0A%20%20%20%20B--%3EC%0A%20%20%20%20C--%3ED%0A%20%20%20%20C--%3EF%0A' ``` -![Example request in Postman](example.png "Example request in Postman") \ No newline at end of file +![Example request in Postman](example.png "Example request in Postman") + +### Caching + +All generated diagram input and output will be cached for 1 hour. The cache time is reset whenever a cached diagram is accessed. + \ No newline at end of file