mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 12:57:47 +00:00
@@ -1,10 +1,21 @@
|
||||
import { join } from 'path';
|
||||
import { readFileSync } from 'fs';
|
||||
// Currently we read & parse the README file from zeit/now-examples
|
||||
// TODO: create a `manifest.json` for zeit/now-examples
|
||||
|
||||
const manifest = readFileSync(
|
||||
join('..', '..', '..', 'examples', 'manifest.json')
|
||||
);
|
||||
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() {
|
||||
return manifest;
|
||||
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