refactor: clean up comments and unused code in various files

This commit is contained in:
bobbert committed 2026-04-14 19:05:22 +01:00
1 parent 9b20804f5a
commit bb6bd0f4b3
28 files changed
+14 -392

No files matched your search

-25
View File
@@ -1,31 +1,9 @@
/**
* NAS Backend API Test
*
* Usage:
* node TEST/testNASAPI.js
*
* Environment variables:
* BACKEND_URL (default http://localhost:3001)
* NAS_HOST e.g. 192.168.1.100
* NAS_PORT default 22
* NAS_USER SSH username
* NAS_PASS SSH password
* NAS_FOLDER default /home/user/photos
*
* Tests:
* 1. Backend health check
* 2. SFTP connect
* 3. List directory
* 4. Disconnect
*/
const BACKEND_URL = process.env.BACKEND_URL || 'http://localhost:3001';
async function main() {
console.log('\n--- NAS Backend API Test ---');
console.log(`Backend: ${BACKEND_URL}\n`);
// 1 — Health check
console.log('[1] Health check...');
try {
const res = await fetch(`${BACKEND_URL}/api/health`);
@@ -50,7 +28,6 @@ async function main() {
return;
}
// 2 — Connect
let connectionToken = null;
console.log(`[2] SFTP connect to ${host}:${port}...`);
try {
@@ -74,7 +51,6 @@ async function main() {
Authorization: `Bearer ${connectionToken}`,
};
// 3 — List directory
console.log(`[3] List directory "${folder}"...`);
try {
const res = await fetch(`${BACKEND_URL}/api/sftp/list`, {
@@ -93,7 +69,6 @@ async function main() {
console.log(` Failed: ${err.message}\n`);
}
// 4 — Disconnect
console.log('[4] Disconnect...');
try {
const res = await fetch(`${BACKEND_URL}/api/sftp/disconnect`, {