mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 12:57:46 +00:00
This removes the reliance on raw github hosting and instead relies on the Vercel deployment hosting the logo images. Since we already have static files in each deployment (tarballs), it makes sense to start adding static images too.
34 lines
920 B
TypeScript
34 lines
920 B
TypeScript
import { VercelRequest, VercelResponse } from '@vercel/node';
|
|
import { withApiHandler } from './_lib/util/with-api-handler';
|
|
import _frameworks, { Framework } from '../packages/frameworks';
|
|
|
|
const frameworks = (_frameworks as Framework[])
|
|
.sort(
|
|
(a, b) =>
|
|
(a.sort || Number.MAX_SAFE_INTEGER) - (b.sort || Number.MAX_SAFE_INTEGER)
|
|
)
|
|
.map(frameworkItem => {
|
|
const framework = {
|
|
...frameworkItem,
|
|
detectors: undefined,
|
|
sort: undefined,
|
|
dependency: undefined,
|
|
defaultRoutes: undefined,
|
|
};
|
|
|
|
return framework;
|
|
});
|
|
|
|
export default withApiHandler(async function (
|
|
req: VercelRequest,
|
|
res: VercelResponse
|
|
) {
|
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
res.setHeader('Access-Control-Allow-Methods', 'GET');
|
|
res.setHeader(
|
|
'Access-Control-Allow-Headers',
|
|
'Authorization, Accept, Content-Type'
|
|
);
|
|
return res.status(200).json(frameworks);
|
|
});
|