wulf-pulse/app/api/rmm-test/route.ts
Lorentz Hinrichsen 3c3124d8c9 Restructure: rename to Pulse and move app to root
- Renamed project from PSA-Utils to Pulse
- Moved all app files from autotask-app/ to root
- Updated package.json name to 'pulse'
- Updated Docker container names to pulse-app and pulse-redis
- Updated Docker network name to pulse-network
2025-10-28 23:08:54 -04:00

32 lines
935 B
TypeScript

import { NextRequest, NextResponse } from 'next/server';
import { getDattoRMMClient } from '@/lib/services/datto-rmm-factory';
export async function GET(request: NextRequest) {
try {
console.log('Testing Datto RMM connection...');
const rmmClient = getDattoRMMClient();
// Try to get sites as a test
const sites = await rmmClient.getSites();
return NextResponse.json({
success: true,
message: 'Successfully connected to Datto RMM',
sitesCount: sites.length,
sites: sites.slice(0, 5).map(s => ({
id: s.id,
name: s.name,
description: s.description
}))
});
} catch (error) {
console.error('RMM test failed:', error);
return NextResponse.json({
success: false,
error: error instanceof Error ? error.message : 'Unknown error',
hint: 'Check console for detailed error information'
}, { status: 500 });
}
}