Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions web-server/app/ping/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { NextResponse } from "next/server";

export function GET() {
return new NextResponse('OK', {
status: 200,
headers: { 'Content-Type': 'text/plain' },
});
}
19 changes: 19 additions & 0 deletions web-server/app/status/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NextResponse } from 'next/server';
import { readFileSync } from 'fs';
import { join } from 'path';

let version = 'unknown';
try {
const pkgPath = join(process.cwd(), 'package.json');
const pkgJson = JSON.parse(readFileSync(pkgPath, 'utf8'));
version = pkgJson.version || 'unknown';
} catch (err) {
console.log(err);
}

export async function GET() {
return NextResponse.json({
status: 'OK',
version,
});
}