diff --git a/.gitignore b/.gitignore index 9d988e5..9abf34b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .well-known/ api/endpoint/* -!api/endpoint/ping.php \ No newline at end of file +!api/endpoint/status.php \ No newline at end of file diff --git a/api/endpoint/ping.php b/api/endpoint/ping.php deleted file mode 100644 index 019f31c..0000000 --- a/api/endpoint/ping.php +++ /dev/null @@ -1,3 +0,0 @@ - 1, + "label" => "API", + "message" => $message, + "color" => $color, + "isError" => $isError + ]; + + echo json_encode($response); + } + + function getStatus() { + if(!is_dir($api)) { + response(false); + return false; + } + + response(true); + } + + getStatus(); \ No newline at end of file diff --git a/server.conf b/server.conf index 2df83e2..fe8cda0 100644 --- a/server.conf +++ b/server.conf @@ -59,15 +59,13 @@ server { root /var/www/victorwesterlund.com/api/endpoint; - index router.php; - location / { try_files $uri $uri.html $uri/ @extensionless-php; index index.html index.htm index.php; } location ~ \.php$ { - try_files $uri $uri/ =404; + try_files $uri $uri/ /router.php =404; add_header Access-Control-Allow-Origin *; include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.3-fpm.sock;