File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1+ import { NextResponse } from 'next/server' ;
2+
3+ // This endpoint proxies the release registry to not require access to another domain
4+ // when visiting sourcegraph.com/docs. This might help some customers with strict firewalls.
5+ export async function GET ( ) {
6+ const res = await fetch (
7+ 'https://releaseregistry.sourcegraph.com/v1/releases/sourcegraph' ,
8+ { next : { revalidate : 300 } }
9+ ) ;
10+
11+ if ( ! res . ok ) {
12+ return NextResponse . json (
13+ { error : 'Failed to fetch releases' } ,
14+ { status : 500 }
15+ ) ;
16+ }
17+
18+ const data = await res . json ( ) ;
19+ return NextResponse . json ( data ) ;
20+ }
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export function SupportedReleasesTable() {
6262 const [ error , setError ] = useState < string | null > ( null ) ;
6363
6464 useEffect ( ( ) => {
65- fetch ( 'https://releaseregistry.sourcegraph.com/v1/ releases/sourcegraph ' )
65+ fetch ( '/api/ releases' )
6666 . then ( res => {
6767 if ( ! res . ok ) throw new Error ( 'Failed to fetch releases' ) ;
6868 return res . json ( ) ;
You can’t perform that action at this time.
0 commit comments