From 07bffab979f9424bd8cf92605388e0d75c005cce Mon Sep 17 00:00:00 2001 From: Christoph Kappestein Date: Fri, 15 Dec 2017 19:51:29 +0100 Subject: [PATCH] add missing help files --- public/fusio/help/action/file.md | 12 ++++++++++++ public/fusio/help/action/http.md | 20 ++++++++++++++++++++ public/fusio/help/action/php.md | 30 ++++++++++++++++++++++++++++++ public/fusio/help/action/v8.md | 27 +++++++++++---------------- public/fusio/help/cronjob.md | 6 ++++++ 5 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 public/fusio/help/action/file.md create mode 100644 public/fusio/help/action/http.md create mode 100644 public/fusio/help/action/php.md create mode 100644 public/fusio/help/cronjob.md diff --git a/public/fusio/help/action/file.md b/public/fusio/help/action/file.md new file mode 100644 index 00000000..94b8da9b --- /dev/null +++ b/public/fusio/help/action/file.md @@ -0,0 +1,12 @@ + +## File + +Path to a simple static json file. Fusio will simply forward the content to +the client. This is helpful if you want to build fast an sample API with dummy +responses. + +### Example + +``` +/tmp/static.json +``` diff --git a/public/fusio/help/action/http.md b/public/fusio/help/action/http.md new file mode 100644 index 00000000..d0c04534 --- /dev/null +++ b/public/fusio/help/action/http.md @@ -0,0 +1,20 @@ + +## HTTP + +Contains a HTTP url. Fusio automatically adds some additional headers to the +request which may be used by the endpoint i.e.: + +```http +X-Fusio-Route-Id: 72 +X-Fusio-User-Anonymous: 1 +X-Fusio-User-Id: 4 +X-Fusio-App-Id: 3 +X-Fusio-App-Key: 1ba7b2e5-fa1a-4153-8668-8a855902edda +X-Fusio-Remote-Ip: 127.0.0.1 +``` + +### Example + +``` +http://foo.bar +``` diff --git a/public/fusio/help/action/php.md b/public/fusio/help/action/php.md new file mode 100644 index 00000000..668ec84d --- /dev/null +++ b/public/fusio/help/action/php.md @@ -0,0 +1,30 @@ + +## PHP + +Path to a PHP file. Fusio simply includes this file on execution. In the +following an example implementation: + +```php +build(200, [], [ + 'message' => 'Hello World!', +]); +``` + +### Example + +``` +/tmp/Todo/collection.php" +``` diff --git a/public/fusio/help/action/v8.md b/public/fusio/help/action/v8.md index 4bb4d6b0..86e1d505 100644 --- a/public/fusio/help/action/v8.md +++ b/public/fusio/help/action/v8.md @@ -1,22 +1,17 @@ ## V8 -Fusio uses the V8 engine to offer a simple javascript API to implement the -endpoint logic. More detailed information about the [v8 API](http://www.fusio-project.org/documentation/v8) -at the website. +Contains javascript code. Fusio uses the internal v8 engine to execute the js +code. This is suitable for javascript developers who like to write the code in +[javascript](http://www.fusio-project.org/documentation/v8). Note the v8 +implementation requires the [php v8](https://github.com/pinepain/php-v8) +extension. ### Example - var id = request.getUriFragment('id'); - var connection = connector.get('mysql-connection'); - - var row = connection.fetchAssoc('SELECT * FROM my_table WHERE id = :id', {id: id}); - - if (row) { - response.setBody(row); - } else { - response.setStatusCode(404); - response.setBody({ - message: "Entry not available" - }); - } +```javascript +response.setStatusCode(200); +response.setBody({ + message: "Hello World!" +}); +``` diff --git a/public/fusio/help/cronjob.md b/public/fusio/help/cronjob.md new file mode 100644 index 00000000..30889635 --- /dev/null +++ b/public/fusio/help/cronjob.md @@ -0,0 +1,6 @@ + +## Cronjob + +A cronjob provides a way to execute an action in specific time intervals. + + \ No newline at end of file