-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
18 lines (16 loc) · 778 Bytes
/
Makefile
File metadata and controls
18 lines (16 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.PHONY: test-remote test-local
test-remote:
@if [ -z "$(REMOTE_URL)" ]; then echo "Error: set REMOTE_URL (e.g. make test-remote REMOTE_URL=https://your-function-url)"; exit 1; fi
@(printf '{"imageUrl": "data:image/png;base64,'; base64 -w 0 __fixtures__/img.png; printf '"}') | \
curl -X POST $(REMOTE_URL) \
-H "Content-Type: application/json" \
-d @- \
--output __fixtures__/img-no-bg-curl.png
@echo "Result saved to __fixtures__/img-no-bg-curl.png"
test-local:
@(printf '{"imageUrl": "data:image/png;base64,'; base64 -w 0 __fixtures__/img.png; printf '"}') | \
curl -X POST http://localhost:8080/remove-bg \
-H "Content-Type: application/json" \
-d @- \
--output __fixtures__/img-no-bg-local.png
@echo "Result saved to __fixtures__/img-no-bg-local.png"