<?php
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json; charset=UTF-8');
echo file_get_contents('db.json');
image_1.style.opacity = 0;
image_1.src = `img/works/works1/${key[rand(0, 3)]}`;
do {
image_1.style.opacity = image_1.style.opacity + 0.05;
await new Promise(function(s) { setTimeout(s, 50); });
} while (image_1.style.opacity < 1);
<FilesMatch "\.json$">
Header set Cache-Control: "no-store, no-cache, must-revalidate"
Header set Access-Control-Allow-Origin: "*"
Header set Access-Control-Allow-Methods: "POST, GET, OPTIONS"
</FilesMatch>