Created
June 17, 2020 15:47
-
-
Save Andy-set-studio/59caf21e1d2a562844ccf876e8d2db61 to your computer and use it in GitHub Desktop.
JavaScript Data File Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch'); | |
module.exports = async () => { | |
try { | |
const res = await fetch( | |
'https://11ty-from-scratch-content-feeds.piccalil.li/media.json' | |
); | |
const {items} = await res.json(); | |
return items; | |
} catch (ex) { | |
return []; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment