We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 094d32c commit 2945eceCopy full SHA for 2945ece
server.php
@@ -3,7 +3,7 @@
3
isset($_SERVER['argv'][0]) && $_SERVER['argv'][0] === 'server.php';
4
5
if($scriptInvokedFromCli) {
6
- echo 'server listening on port 3000';
+ echo 'starting server on port 3000' . PHP_EOL;
7
exec('php -S localhost:3000 -t public server.php');
8
} else {
9
return routeRequest();
@@ -20,7 +20,7 @@ function routeRequest()
20
if($_SERVER['REQUEST_METHOD'] === 'POST') {
21
$commentsDecoded = json_decode($comments, true);
22
$commentsDecoded[] = ['author' => $_POST['author'],
23
- 'text' => $_POST['text']];
+ 'text' => $_POST['text']];
24
25
$comments = json_encode($commentsDecoded);
26
file_put_contents('_comments.json', $comments);
0 commit comments