File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1- import { NextResponse } from 'next/server' ;
2- import type { NextRequest } from 'next/server' ;
1+ import { NextResponse } from "next/server" ;
32
4- // For plain text response
5- export function GET ( request : NextRequest ) {
6- return new Response ( 'OK' , {
3+ export function GET ( ) {
4+ return new NextResponse ( 'OK' , {
75 status : 200 ,
86 headers : { 'Content-Type' : 'text/plain' } ,
97 } ) ;
Original file line number Diff line number Diff line change 11import { NextResponse } from 'next/server' ;
2- import type { NextRequest } from 'next/server' ;
32import { readFileSync } from 'fs' ;
43import { join } from 'path' ;
54
6- // Read and cache the version at module load
75let version = 'unknown' ;
86try {
97 const pkgPath = join ( process . cwd ( ) , 'package.json' ) ;
108 const pkgJson = JSON . parse ( readFileSync ( pkgPath , 'utf8' ) ) ;
119 version = pkgJson . version || 'unknown' ;
1210} catch ( err ) {
13- console . log ( err ) ;
14- // If reading fails, version stays 'unknown'
11+ console . log ( err ) ;
1512}
1613
17- export async function GET ( request : NextRequest ) {
14+ export async function GET ( ) {
1815 return NextResponse . json ( {
1916 status : 'OK' ,
2017 version,
2118 } ) ;
22- }
19+ }
You can’t perform that action at this time.
0 commit comments