-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
79 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
## PHP | ||
|
||
Path to a PHP file. Fusio simply includes this file on execution. In the | ||
following an example implementation: | ||
|
||
```php | ||
<?php | ||
/** | ||
* @var \Fusio\Engine\ConnectorInterface $connector | ||
* @var \Fusio\Engine\ContextInterface $context | ||
* @var \Fusio\Engine\RequestInterface $request | ||
* @var \Fusio\Engine\Response\FactoryInterface $response | ||
* @var \Fusio\Engine\ProcessorInterface $processor | ||
* @var \Psr\Log\LoggerInterface $logger | ||
* @var \Psr\SimpleCache\CacheInterface $cache | ||
*/ | ||
|
||
// @TODO handle request and return response | ||
|
||
$response->build(200, [], [ | ||
'message' => 'Hello World!', | ||
]); | ||
``` | ||
|
||
### Example | ||
|
||
``` | ||
/tmp/Todo/collection.php" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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!" | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
## Cronjob | ||
|
||
A cronjob provides a way to execute an action in specific time intervals. | ||
|
||
|