Add nodes

This commit is contained in:
admin committed 2026-03-14 13:50:54 +01:00
1 parent 9bc1c18731
commit cfefd6c928
6 files changed
+27 -188

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
<?php
require "../api.php";
$api = new mcServApi();
if (!$api->checkAuth()) {
die('{"status":500, "error":"Unauthorized"}');
}
+10
View File
@@ -53,6 +53,16 @@ CREATE TABLE IF NOT EXISTS api_keys (
$db->exec($sql);
$sql = "
CREATE TABLE IF NOT EXISTS nodes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(50) UNIQUE NOT NULL,
endpoint VARCHAR(200) UNIQUE NOT NULL
)
";
$db->exec($sql);
$sql = "
INSERT INTO users (username, mail, passwd) VALUES (:user, :mail, :passwd)
";