From 162e4fb74d66811b9776a67f67b569885b74d231 Mon Sep 17 00:00:00 2001 From: Michael Hopkins Date: Fri, 8 May 2015 13:57:02 -0500 Subject: [PATCH] Update server.php This change allows requests for comments.json with a timestamp param at the end, which is how React requests it. --- server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.php b/server.php index e140ea83..7a5d5078 100644 --- a/server.php +++ b/server.php @@ -21,7 +21,7 @@ function routeRequest() case '/': echo file_get_contents('./public/index.html'); break; - case '/comments.json': + case (preg_match('/comments.json*/', $_SERVER["REQUEST_URI"]) ? true : false): if($_SERVER['REQUEST_METHOD'] === 'POST') { $commentsDecoded = json_decode($comments, true); $commentsDecoded[] = ['author' => $_POST['author'],