Skip to content

Commit 162e4fb

Browse files
Update server.php
This change allows requests for comments.json with a timestamp param at the end, which is how React requests it.
1 parent 548ce93 commit 162e4fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function routeRequest()
2121
case '/':
2222
echo file_get_contents('./public/index.html');
2323
break;
24-
case '/comments.json':
24+
case (preg_match('/comments.json*/', $_SERVER["REQUEST_URI"]) ? true : false):
2525
if($_SERVER['REQUEST_METHOD'] === 'POST') {
2626
$commentsDecoded = json_decode($comments, true);
2727
$commentsDecoded[] = ['author' => $_POST['author'],

0 commit comments

Comments
 (0)