Try passing props on falsy pageListing

This commit is contained in:
Sam Carlton 2021-09-11 16:23:07 -05:00
parent 66315cfc40
commit 73ebd03c57

View file

@ -41,7 +41,7 @@ export async function getStaticProps({ params }) {
// return JSON.parse(endpointsJson)
// })
const allEndpointListings = await fs.stat('./static/eleventy-endpointsdddd.json')
const allEndpointListings = await fs.stat('./static/eleventy-endpoints.json')
const currentDirectory = await fs.readdir('./')
// console.log('endpointListings', endpointListings[0])
@ -74,7 +74,12 @@ export async function getStaticProps({ params }) {
...pageListing
},
revalidate: ONE_MINUTE
} : { notFound: true }
} : {
notFound: true,
props: {
error: 'falsy pageListing'
},
}
} catch (error) {
// The Twitter API most likely died
console.error(error)