feat: open page api
This commit is contained in:
17
apps/openpage-api/app/github/route.ts
Normal file
17
apps/openpage-api/app/github/route.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { type NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
const paths = [
|
||||
{ path: '/forks', description: 'GitHub Forks' },
|
||||
{ path: '/stars', description: 'GitHub Stars' },
|
||||
{ path: '/issues', description: 'GitHub Merged Issues' },
|
||||
{ path: '/prs', description: 'GitHub Pull Request' },
|
||||
];
|
||||
|
||||
export function GET(request: NextRequest) {
|
||||
const url = request.nextUrl.toString();
|
||||
const apis = paths.map(({ path, description }) => {
|
||||
return { path: url + path, description };
|
||||
});
|
||||
|
||||
return NextResponse.json(apis);
|
||||
}
|
||||
Reference in New Issue
Block a user