Contains various services used in stanwood.
Includes:
- html2pdf-service - Converts html to pdf
- image-service - Stores and caches images using GCP. Allows to resize and crop images.
- pdf-service - Splits PDF file with multiple pages into separate images.
- qr-code-service - generates QR code for given data.
- mock-api-service - Simple service for mocking API responses based on GitHub repository.
curl https://<project_name>.appspot.com/pdf/v1/<quoted_pdf_url>
curl -L "https://<project_name>.appspot.com/pdf/v1/<quoted_pdf_url>/pages/1.<image_extension:png,jpg,...>"
I recommend to open it in browser with logged in GCP account.
curl https://<project_name>.appspot.com/<namespace>/tokens
Response:
{
'namespace': '<namespace>',
'token': 'XXXXXXXXXXXXX'
}
curl -L "https://<project_name>.appspot.com/image?url=<image_url>" -H "X-Auth-Token: <token>" > "<image_name>"
curl -L "https://<project_name>.appspot.com/image?url=<image_url>&width=1024" -H "X-Auth-Token: <token>" > "<image_name>"
curl -L "https://<project_name>.appspot.com/image?url=<image_url>&crop=200,200,400,400" -H "X-Auth-Token: <token>" > "<image_name>"
curl -X GET "https://your-app-id.appspot.com/generate?data=https%3A%2F%2Fstanwood.io&format=json&version=1
curl -X GET "https://your-app-id.appspot.com/generate?data=https%3A%2F%2Fstanwood.io&version=40
curl -X GET "https://your-app-id.appspot.com/generate?data=https%3A%2F%2Fstanwood.io&format=image
Note
- The
version
parameter is an integer from 1 to 40 that controls the size of the QR Code (the smallest, version 1, is a 21x21 matrix).
$ curl -X GET \
"https://<PROJECT_ID>.appspot.com/v1/mock/<ORGANIZATION_NAME>/<REPO_NAME>/contents/<PATH_TO_FILE>"
$ curl -X GET \
"https://<PROJECT_ID>.appspot.com/v1/mock/<ORGANIZATION_NAME>/<REPO_NAME>/contents/<PATH_TO_FILE>?ref=<REF_NAME>"
$ curl -X GET/POST/DELETE/PUT/PATCH/... \
--data '{"happy": true}' \
-H "Content-Type: application/json" \
"https://<PROJECT_ID>.appspot.com/v1/mock/<ORGANIZATION_NAME>/<REPO_NAME>/contents/<PATH_TO_FILE>"