Move 150+ scripts from root and scripts/ into client/project directories: - clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts) - clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination) - clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups) - projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto) - projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts) - clients/glaztech/scripts/ (1 file: CentraStage removal) Also reorganized: - VPN scripts → infrastructure/vpn-configs/ - Retrieved API/JS files → api/ - Forum posts → projects/community-forum/forum-posts/ - SSH docs → clients/internal-infrastructure/docs/ - NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/ - ACG website files → projects/internal/acg-website-2025/ - Dataforth docs → clients/dataforth/docs/ - schema-retrieved.sql → docs/database/ Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history). Root reduced from 220+ files to 62 items (docs + directories only). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
/**
|
|
* Test Data Database Server
|
|
* Express.js server with search API and web interface
|
|
*/
|
|
|
|
const express = require('express');
|
|
const cors = require('cors');
|
|
const path = require('path');
|
|
|
|
const apiRoutes = require('./routes/api');
|
|
|
|
const app = express();
|
|
const PORT = process.env.PORT || 3000;
|
|
|
|
// Middleware
|
|
app.use(cors());
|
|
app.use(express.json());
|
|
app.use(express.static(path.join(__dirname, 'public')));
|
|
|
|
// API routes
|
|
app.use('/api', apiRoutes);
|
|
|
|
// Serve index.html for root
|
|
app.get('/', (req, res) => {
|
|
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
|
});
|
|
|
|
// Start server - bind to 0.0.0.0 for LAN access
|
|
const HOST = '0.0.0.0';
|
|
app.listen(PORT, HOST, () => {
|
|
console.log(`\n========================================`);
|
|
console.log(`Test Data Database Server`);
|
|
console.log(`========================================`);
|
|
console.log(`Server running on all interfaces (${HOST}:${PORT})`);
|
|
console.log(`Local: http://localhost:${PORT}`);
|
|
console.log(`LAN: http://192.168.0.6:${PORT}`);
|
|
console.log(`API endpoints:`);
|
|
console.log(` GET /api/search?serial=...&model=...`);
|
|
console.log(` GET /api/record/:id`);
|
|
console.log(` GET /api/datasheet/:id`);
|
|
console.log(` GET /api/stats`);
|
|
console.log(` GET /api/export?format=csv&...`);
|
|
console.log(`========================================\n`);
|
|
});
|
|
|
|
module.exports = app;
|
|
|