[examples] Make -functions example the default (#3541)

* Remove now-examples references

* Adjust gatsby example

* Adjust svelte example

* Adjust vanilla example
This commit is contained in:
Andy
2020-01-10 12:48:45 +01:00
committed by GitHub
parent 2db627b79d
commit 0c6c6677a7
54 changed files with 215 additions and 1604 deletions

View File

@@ -44,16 +44,9 @@ export default withApiHandler(async function(req: NowRequest, res: NowResponse)
}
const example = segment.slice(0, -ext.length);
let directory;
if (Number(req.query.version) === 1) {
// The old cli is pinned to a specific commit hash
await extract('https://github.com/zeit/now-examples/archive/7c7b27e49b8b17d0d3f0e1604dc74fd005cd69e3.zip', TMP_DIR);
directory = `${TMP_DIR}/now-examples-7c7b27e49b8b17d0d3f0e1604dc74fd005cd69e3/${example}`;
} else {
await extract('https://github.com/zeit/now/archive/master.zip', TMP_DIR);
directory = `${TMP_DIR}/now-master/examples/${example}`;
}
await extract('https://github.com/zeit/now/archive/master.zip', TMP_DIR);
const directory = `${TMP_DIR}/now-master/examples/${example}`;
if (!isDirectory(directory)) {
return notFound(res, `Example '${example}' was not found.`);