This small Sinatra app implements a basic webservice for testing your Layer client. Just click the button below and deploy this webservice to Heroku:
If you click on the Heroku Deploy button all mandatory variables you need will be shown. You can set these variables via command line afterwards:
heroku config:set LAYER_PROVIDER_ID=provider_id LAYER_KEY_ID=key_id LAYER_PRIVATE_KEY="some real long and multiline RSA super key"
For all other deployment methods (or testing it locally) just set the appropriate variables
LAYER_PROVIDER_ID=provider_id
LAYER_KEY_ID=key_id
LAYER_PRIVATE_KEY="some real long and multiline RSA super key"
curl -X "POST" "http://your-new-app.herokuapp.com/hello/layer" \
-d "user_id=1" \
-d "nonce=2"
This will be your response:
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyIsImN0eSI6ImxheWVyLWVpdDt2PTEiLCJraWQiOiJmNmM0OGNjZS1jZDY3LTExZTQtYTM4NC1lYWU4YzEwMDEwYWEifQ.eyJpc3MiOiI5ZTM2OTc4NC05OGFlLTExZTQtYjYyNy03NWJkMDAwMDAwZTYiLCJwcm4iOiIiLCJpYXQiOjE0MjY4ODM1MzksImV4cCI6MTQyODA5MzEzOSwibmNlIjpudWxsfQ.GYawDvYhR0ygV5e7BQOaPBKUkXZsj5rHtePV2UcwObUHIGRajzuOlDHcamdw"
}
Thanks to @layer for this awesome service.
Webservice brought to you by @dreimannzelt, ©2015