<?php

function getData($url)
{
    $ch = curl_init($url);

    curl_setopt(
        $ch,
        CURLOPT_RETURNTRANSFER,
        true
    );

    $result =
        curl_exec($ch);

    curl_close($ch);

    return
        json_decode(
            $result,
            true
        );
}

echo
    "JPostma";
<script>

$(document).ready(
    function() {

        $(".button").click(
            function() {

                $.ajax({

                    url: "/api/",
                    type: "POST",

                    success:
                    function(response) {

                        console.log(
                            "Success"
                        );

                    }

                });

            }
        );

    }
);

</script>
user@server:~$

sudo systemctl status nginx

● nginx.service

Loaded: loaded

Active:
active (running)

Server:
Ubuntu Linux

PHP-FPM:
running

MySQL:
running

CUPS:
running

SYSTEM READY...
SYSTEM ONLINE