diff options
author | hitlerrip <git@hitler.rip> | 2025-07-29 19:17:50 +0200 |
---|---|---|
committer | hitlerrip <git@hitler.rip> | 2025-07-29 19:17:50 +0200 |
commit | 3c0ebfbbcd9d41b936ede928af05db9f15733d1a (patch) | |
tree | 0cfda95dd3525debbda0e0b4ece13501b5d81f48 /backend | |
download | hitler-clicker-3c0ebfbbcd9d41b936ede928af05db9f15733d1a.tar.gz hitler-clicker-3c0ebfbbcd9d41b936ede928af05db9f15733d1a.tar.bz2 hitler-clicker-3c0ebfbbcd9d41b936ede928af05db9f15733d1a.zip |
init
base to build this game off of
Diffstat (limited to 'backend')
-rw-r--r-- | backend/docker-test-env/compose.yml | 10 | ||||
-rw-r--r-- | backend/index.php | 17 |
2 files changed, 27 insertions, 0 deletions
diff --git a/backend/docker-test-env/compose.yml b/backend/docker-test-env/compose.yml new file mode 100644 index 0000000..fd109f9 --- /dev/null +++ b/backend/docker-test-env/compose.yml @@ -0,0 +1,10 @@ +services: + db: + image: mariadb:11 + environment: + MARIADB_ROOT_PASSWORD: aA1234Aa + MARIADB_USER: db + MARIADB_PASSWORD: aA1234Aa + MARIADB_DATABASE: hitlerclicker + ports: + - 3306:3306 diff --git a/backend/index.php b/backend/index.php new file mode 100644 index 0000000..dead696 --- /dev/null +++ b/backend/index.php @@ -0,0 +1,17 @@ +<?php +header('Content-Type: application/json; charset=UTF-8'); + +try { + $pdo = new PDO("mysql:host=127.0.0.1;dbname=hitlerclicker", "root", "aA1234Aa"); +} catch(PDOException $e) { + die('{ "status": "database offline" }'); +}; + +$query = $pdo->prepare("CREATE TABLE IF NOT EXISTS `hitlerclicker`.`stats` ( `team` VARCHAR(256) NOT NULL DEFAULT uuid() , `clicks` INT(128) unsigned zerofill NOT NULL DEFAULT '0', PRIMARY KEY (`team`) ) ENGINE = InnoDB;"); +$query->execute(); +$query = $pdo->prepare("CREATE TABLE IF NOT EXISTS `hitlerclicker`.`users` ( `name` VARCHAR(256) NOT NULL DEFAULT uuid() , `password` VARCHAR(256) NOT NULL , `team` VARCHAR(256) NOT NULL DEFAULT 'axis' , `clicks` INT(128) unsigned zerofill NOT NULL DEFAULT '0', PRIMARY KEY (`name`) ) ENGINE = InnoDB;"); +$query->execute(); + +echo '{ "status": "online" }'; + +?> |