diff --git a/README.md b/README.md index 0b4295f..289c595 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,15 @@ # dx 4 -run +### run +- frontend `bun dev --host` +- backend `cd ./backend-php/; ./dev.ps1` or `cat ./dev.ps1 | sh` if you are in other os -`bun dev --host` and `cd ./backend-php/; ./dev.ps1` or `cat ./dev.ps1 | sh` if you are in other os +### IMPORTANT -# IMPORTANT -change `API_BASE_URL` in `src/App.jsx` \ No newline at end of file +- main + - change `API_BASE_URL` in `src/App.jsx` +- dx4dashboard + - change `base` in `vite.config.ts` + - change `API_BASE_URL` and `CLIENT_FRONTEND_URL` in `src/App.jsx` +- backend + - change `ADMIN_PASS` and `API_PATH` in `admin_api.php` \ No newline at end of file diff --git a/archive.txt b/archive.txt deleted file mode 100644 index 77c4681..0000000 --- a/archive.txt +++ /dev/null @@ -1,11 +0,0 @@ -todo md - diff --git a/backend-go.7z b/backend-go.7z deleted file mode 100644 index 806f17c..0000000 Binary files a/backend-go.7z and /dev/null differ diff --git a/backend-php/.gitignore b/backend-php/.gitignore index 5a95457..0af5d57 100644 --- a/backend-php/.gitignore +++ b/backend-php/.gitignore @@ -1,2 +1,4 @@ api.lock -_api.lock \ No newline at end of file +_api.lock + +data.db \ No newline at end of file diff --git a/backend-php/admin_api.php b/backend-php/admin_api.php index 67834aa..c58ef19 100644 --- a/backend-php/admin_api.php +++ b/backend-php/admin_api.php @@ -3,7 +3,6 @@ include 'k-api.php'; const ADMIN_PASS = "superdengipassword4"; -const SECRET_KEY = "dengisecretkey_monay_ivan_pletnev"; const API_PATH = "./"; function db() @@ -28,7 +27,7 @@ function relativePathToUrl($rel) function FastDBReq(PDO $db, string $sql, array $params = []): array -{ +{ try { $stmt = $db->prepare($sql); $stmt->execute($params); diff --git a/backend-php/api.php b/backend-php/api.php index 7575dee..aa99092 100644 --- a/backend-php/api.php +++ b/backend-php/api.php @@ -8,7 +8,7 @@ function db() return $pdo; }; -function findClosestDateSort($array, $targetDate) +function findClosestDateSort(array $array, string $targetDate) { if (empty($array) || !preg_match('/^\d{1,2}-\d{1,2}-\d{2}$/', $targetDate)) { return null; diff --git a/backend-php/t.php b/backend-php/t.php deleted file mode 100644 index c4e7fac..0000000 --- a/backend-php/t.php +++ /dev/null @@ -1,2 +0,0 @@ -