Skip to content

Instantly share code, notes, and snippets.

@d00rman
Forked from Pchelolo/gist:e15bddd617326999115a
Last active August 29, 2015 14:26
Show Gist options
  • Save d00rman/4f25c8609be13d4fb4f3 to your computer and use it in GitHub Desktop.
Save d00rman/4f25c8609be13d4fb4f3 to your computer and use it in GitHub Desktop.
on_setup:
- setup_png_storage:
request:
method: put
uri: /{domain}/sys/key_value/postservice.png
on_request:
- try_storage_and_return:
request:
method: get
headers:
cache-control: '{cache-control}'
uri: /{domain}/sys/key_value/postservice.png/{hash}
return_if:
status: [ 200 ]
- get_post:
request:
uri: /{domain}/sys/post_data/postservice/{hash}
- new_png:
request:
method: post
uri: http://some.post.service/png
body: '{$.get_post.body}'
- save_new_png:
request:
method: put
uri: /{domain}/sys/key_value/postservice.png
headers: '{$.new_png.headers}'
body: '{$.new_png.body}'
response: '${$.new_png}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment