Skip to content

Instantly share code, notes, and snippets.

@Pchelolo
Created July 31, 2015 15:52
Show Gist options
  • Save Pchelolo/e15bddd617326999115a to your computer and use it in GitHub Desktop.
Save Pchelolo/e15bddd617326999115a 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}'
- return_result:
return_if:
'{$.new_png.status}' : [ 2xx ]
response: '{$.new_png}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment