From 574168ad92158ed2eadae4894f68d22777dfa70e Mon Sep 17 00:00:00 2001
From: nzambello
Date: Mon, 25 Mar 2024 11:31:12 +0200
Subject: [PATCH] add preview with try now
---
README.md | 2 +-
index.ts | 91 ++++++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 81 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 5b840bd..9ffc74a 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ Then call the API as, for example:
/api/imgresize/200/200/https%3A%2F%2Fmemori.ai%2Flogo.png
```
-You can also specify a format using the querystring `?format=` and indicating one of the following: avif, gif, heif, jpeg, jpg, jp2, pdf, png, svg, tiff, webp.
+You can also specify a format using the querystring `?format=` and indicating one of the following: `avif`, `gif`, `heif`, `jpeg`, `jpg`, `pdf`, `png`, `svg`, `tiff`, `webp`. (Note: Experimental!)
## Docker
diff --git a/index.ts b/index.ts
index 33840ab..c3c58dc 100644
--- a/index.ts
+++ b/index.ts
@@ -23,24 +23,72 @@ const homepage = html`
Resize images API
+
-
-
The structure of the API path is:
-
/api/imgresize/:width/:height/:url
-
Where width and height can be numbers in pixels or auto.
-
The URL should be URL encoded, which can be done in JS with encodeURIComponent. See MDN ref.
You can also specify a format using the querystring ?format= and indicating one of the following: avif, gif, heif, jpeg, jpg, jp2, pdf, png, svg, tiff, webp.
+
+
Try now
+
+
+
+
Docs
+
The structure of the API path is:
+
/api/imgresize/:width/:height/:url
+
Where width and height can be numbers in pixels or auto.
+
The URL should be URL encoded, which can be done in JS with encodeURIComponent. See MDN ref.
You can also specify a format using the querystring ?format= and indicating one of the following: avif, gif, heif, jpeg, jpg, jp2, pdf, png, svg, tiff, webp. Note: Experimental!