Self-hosted document scanner and media processing tools. - Rust Axum gateway + worker pool with NATS JetStream - Next.js 16 frontend with shadcn/ui - Scanner pipeline: edge detection, warp, binarization, OCR - Image tools: compress, resize, convert - PDF tools: merge, split, compress - CI/CD with Docker multi-stage build Co-Authored-By: Kilo <kilo@kilo.ai>
18 lines
484 B
TypeScript
18 lines
484 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
const RUST_GATEWAY = process.env.RUST_GATEWAY_URL || "http://localhost:3001";
|
|
|
|
export async function GET() {
|
|
try {
|
|
const response = await fetch(`${RUST_GATEWAY}/health`, {
|
|
signal: AbortSignal.timeout(5000),
|
|
});
|
|
const data = await response.json();
|
|
return NextResponse.json(data);
|
|
} catch {
|
|
return NextResponse.json(
|
|
{ status: "error", message: "Gateway unreachable" },
|
|
{ status: 503 },
|
|
);
|
|
}
|
|
} |