Add nodes
This commit is contained in:
9
api/nodes/list.php
Normal file
9
api/nodes/list.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require "../api.php";
|
||||
|
||||
$api = new mcServApi();
|
||||
|
||||
if (!$api->checkAuth()) {
|
||||
die('{"status":500, "error":"Unauthorized"}');
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
";
|
||||
|
||||
Reference in New Issue
Block a user