Skip to content

blockspring/blockspring.php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

blockspring.php

Php library to assist in creating and running blocks (cloud functions) with Blockspring.

Installation

curl -o ./blockspring.php https://raw.githubusercontent.com/blockspring/blockspring-php/master/blockspring.php

Example Usage

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

License

MIT

Contact

Email us: [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages