Skip to content

Commit

Permalink
version endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
platzhersh committed Oct 5, 2020
1 parent 0328c7d commit 277ff43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions data/db-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,21 @@
} else {
echo getHighscore();
}
} else if ($_GET['action'] == 'version') {
echo getVersionInfo();
}
} else echo "define action to call";


function getVersionInfo() {
$strJsonFileContents = file_get_contents("../package.json");
// Convert to array
$array = json_decode($strJsonFileContents, true);
$version = $array['version'];

return $version;
}

function getHighscore($page = 1) {

$db = new SQLite3('pacman.db');
Expand Down

0 comments on commit 277ff43

Please sign in to comment.