You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
446 B
25 lines
446 B
<?php
|
|
|
|
use Kirby\Kql\Kql;
|
|
|
|
return [
|
|
'routes' => function ($kirby) {
|
|
return [
|
|
[
|
|
'pattern' => 'query',
|
|
'method' => 'POST|GET',
|
|
'auth' => $kirby->option('kql.auth') === false ? false : true,
|
|
'action' => function () use ($kirby) {
|
|
$input = $kirby->request()->get();
|
|
$result = Kql::run($input);
|
|
|
|
return [
|
|
'code' => 200,
|
|
'result' => $result,
|
|
'status' => 'ok',
|
|
];
|
|
}
|
|
]
|
|
];
|
|
}
|
|
];
|
|
|