Skip to content

Instantly share code, notes, and snippets.

@Andy-set-studio
Created June 17, 2020 15:47
Show Gist options
  • Save Andy-set-studio/59caf21e1d2a562844ccf876e8d2db61 to your computer and use it in GitHub Desktop.
Save Andy-set-studio/59caf21e1d2a562844ccf876e8d2db61 to your computer and use it in GitHub Desktop.

Revisions

  1. Andy-set-studio created this gist Jun 17, 2020.
    14 changes: 14 additions & 0 deletions media.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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 [];
    }
    };