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 08115a6 commit ddc30f0Copy full SHA for ddc30f0
server.php
@@ -27,11 +27,11 @@
27
28
function routeRequest()
29
{
30
- $comments = file_get_contents('comments.json');
31
$uri = $_SERVER['REQUEST_URI'];
32
if ($uri == '/') {
33
echo file_get_contents('./public/index.html');
34
} elseif (preg_match('/\/api\/comments(\?.*)?/', $uri)) {
+ $comments = file_get_contents('comments.json');
35
if($_SERVER['REQUEST_METHOD'] === 'POST') {
36
$commentsDecoded = json_decode($comments, true);
37
$commentsDecoded[] = [
0 commit comments