Skip to content

Commit

Permalink
chore: add support for eien
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Oct 8, 2022
1 parent bf1d614 commit ecc287d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,21 +421,11 @@ public function cors($options = [])
public static function run(?callable $callback = null)
{
if (class_exists('Leaf\Eien\Server')) {
// this entire part can be added to the run method of the app class
// This would mean that no part of the user's app would be changed
// They just install eien and reap immediete benefits

server()
->wrap(function () use ($callback) {
\ob_start();
parent::run($callback);
ob_end_clean();

return Config::get('response.data');
})
->listen(function ($server) {
echo "Leaf Eien server started on http://127.0.0.1:{$server->port}";
});
->listen();
} else {
return parent::run($callback);
}
Expand Down

0 comments on commit ecc287d

Please sign in to comment.