diff --git a/client/public/lib/remote.mjs b/client/public/lib/remote.mjs deleted file mode 100644 index a445c79..0000000 --- a/client/public/lib/remote.mjs +++ /dev/null @@ -1,24 +0,0 @@ -export async function getPosts(id) { - const BASE_URL = 'https://raymon.dev' - const BASE_ENDPOINT = '/api/posts' - const URL = BASE_URL + BASE_ENDPOINT + (id ? `/${id}` : '?sort=-1') - - let posts = [] - - return await fetch(URL) - .then(res => res.json()) - .then(res => { - if (id !== undefined) { - if (res === undefined) { - throw Error("Response body empty") - } - return [res] - } - else { - return res - } - }) - .catch(err => { - console.log(`Error: ${err}`) - }) -} diff --git a/client/public/posts.html b/client/public/posts.html index f44fd78..2944fd5 100644 --- a/client/public/posts.html +++ b/client/public/posts.html @@ -8,9 +8,6 @@