Revert "[examples] Add manifest.json"

This reverts commit b7eca1d069.
This commit is contained in:
Andy Bitz
2020-01-09 17:28:53 +01:00
parent ac72e944a7
commit c65336e63b
2 changed files with 17 additions and 361 deletions

View File

@@ -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();
}