Php library to assist in creating and running blocks (cloud functions) with Blockspring.
curl -o ./blockspring.php https://raw.githubusercontent.com/blockspring/blockspring-php/master/blockspring.php
Save the following script to an example.php file:
<?php
require('blockspring.php');
$hello_world = function ($request, $response) {
$my_sum = $request->params["num1"] + $request->params["num2"];
$response->addOutput("sum", $my_sum);
$response->end();
};
Blockspring::define($hello_world);
Then in your command line write:
php example.php --num1=20 --num2=50
or
echo '{"num1":20, "num2": 50}' | php example.php
MIT
Email us: [email protected]