<?php
require_once (realpath(dirname(__FILE__) ."/../../../bootstrap.php"));
use Backend\Models\GameJam;


if(isset($_GET['gameJamId'])){
    $dbValue =  GameJam::find($_GET['gameJamId']);
}else{
    $dbValue = GameJam::all();
}

header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $dbValue->toJson(JSON_PRETTY_PRINT);

//var_dump(headers_list());