Ligonier Code Challenge.
This commit is contained in:
commit
86fa02eec9
21 changed files with 4912 additions and 0 deletions
12
app/api/picsum.js
Normal file
12
app/api/picsum.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export async function getPicsumData() {
|
||||
try {
|
||||
const response = await fetch('https://picsum.photos/v2/list');
|
||||
if (!response.ok) {
|
||||
throw new Error('Picsum API unavailable.');
|
||||
}
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Could not fetch data:", error);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue