Skip to content

Commit

Permalink
Merge pull request inventid#67 from inventid/rogierslag-patch-1
Browse files Browse the repository at this point in the history
Document how to send images using the CLI
  • Loading branch information
rogierslag committed May 3, 2016
2 parents 815e398 + 137dad3 commit 279d580
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ On OSX the Docker Toolbox suffices.
3. Next (this also applies for Linux) we'll create the container `mkdir -p /tmp/images && docker build --tag=test . && docker run -p 1337:1337 -v /tmp:/opt/images -v <YOUR_GIT_REPO_LOCATION>/config:/opt/live-image-resize/config test`
4. Now you can start developing. After each change, stop the container (Ctrl-C) and re-execute the command again. Rebuilds of the container are relatively fast.

Quick way to send images (ensure you have `jq` installed)
```bash
IMAGE=test1234567
RES=`curl -vvv -XPOST http://192.168.99.100:1337/token -d "{\"id\": \"${IMAGE}\"}" -H "Content-Type: application/json"`
TOKEN=`echo $RES | jq -r .token`
curl -vvv -XPOST http://192.168.99.100:1337/${IMAGE}.jpg -H "X-Token: ${TOKEN}" -F "image=@/Users/Rogier/Downloads/878261728-5f264338.jpg"
```

## Contributing

You can use the `Dockerfile` to quickly stage stuff locally (on OSX use `docker-machine`).
Expand Down

0 comments on commit 279d580

Please sign in to comment.