Skip to content

Instantly share code, notes, and snippets.

@seregazhuk
Last active May 14, 2018 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seregazhuk/cce3ddffa810fa2a9ba343a44550ce58 to your computer and use it in GitHub Desktop.
Save seregazhuk/cce3ddffa810fa2a9ba343a44550ce58 to your computer and use it in GitHub Desktop.
<?php
function (ServerRequestInterface $request, \React\EventLoop\LoopInterface $loop) {
$childProcess = new \React\ChildProcess\Process('cat pages/index.html');
$childProcess->start($loop);
return new React\Http\Response(200, ['Content-Type' => 'text/html'], $childProcess->stdout);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment