mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 21:07:47 +00:00
Add API for frameworks and examples (#3514)
* Add API for frameworks and examples * Adjust headers * Update frameworks list * Always use latest * Add types * Use now repo for downloading and listing * Use .existsSync * Remove unused packages * Use 307 for redirect * Add examples * Update tsconfig.json Co-Authored-By: Steven <steven@ceriously.com> * Make examples unique * Remove detectors from frameworks API * Use /api instead of Next.js * Install dependencies * Rename project * Change name * Empty * Change name * Update api/tsconfig.json Co-Authored-By: Steven <steven@ceriously.com> * Update examples Co-authored-by: Steven <steven@ceriously.com>
This commit is contained in:
21
api/_lib/examples/example-list.ts
Normal file
21
api/_lib/examples/example-list.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// Currently we read & parse the README file from zeit/now-examples
|
||||
// TODO: create a `manifest.json` for zeit/now-examples
|
||||
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
/**
|
||||
* Fetch and parse the `Frameworks and Libraries` table
|
||||
* in the README file of zeit/now-examples
|
||||
*/
|
||||
export async function getExampleList() {
|
||||
const response = await fetch(
|
||||
`https://raw.githubusercontent.com/zeit/now-examples/master/manifest.json`
|
||||
);
|
||||
|
||||
if (response.status !== 200) {
|
||||
console.log('manifest.json missing in zeit/now-examples');
|
||||
return null;
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
Reference in New Issue
Block a user