Skip to content

Commit

Permalink
chore(examples): log output
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Dec 28, 2020
1 parent b4e02ef commit 4c13da4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/root/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { FunctionalComponent } from 'preact';
import { definePage } from 'microsite/page';
import { Head, seo } from 'microsite/head';
import title from 'title';
import { promises as fsp } from 'fs';

interface IndexProps {
examples: string[]
Expand Down Expand Up @@ -38,8 +37,8 @@ const Index: FunctionalComponent<IndexProps> = ({ examples }) => {

export default definePage(Index, {
async getStaticProps() {
const text = await fsp.readFile('./examples.json').then(res => res.toString());
const examples = JSON.parse(text);
const examples = await fetch('./examples.json').then(res => res.json());
console.log(examples);

return { props: { examples } }
}
Expand Down

0 comments on commit 4c13da4

Please sign in to comment.