Skip to content

Commit

Permalink
Indentation + better startup message
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyMathys committed Feb 5, 2015
1 parent 094d32c commit 2945ece
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
isset($_SERVER['argv'][0]) && $_SERVER['argv'][0] === 'server.php';

if($scriptInvokedFromCli) {
echo 'server listening on port 3000';
echo 'starting server on port 3000' . PHP_EOL;
exec('php -S localhost:3000 -t public server.php');
} else {
return routeRequest();
Expand All @@ -20,7 +20,7 @@ function routeRequest()
if($_SERVER['REQUEST_METHOD'] === 'POST') {
$commentsDecoded = json_decode($comments, true);
$commentsDecoded[] = ['author' => $_POST['author'],
'text' => $_POST['text']];
'text' => $_POST['text']];

$comments = json_encode($commentsDecoded);
file_put_contents('_comments.json', $comments);
Expand Down

0 comments on commit 2945ece

Please sign in to comment.