const axios = require("axios");
const express = require("express");
app.use(express.static("public"));
app.post("/content/resources/find", async (request, response) => {
const { data } = await axios.get("https://picsum.photos/v2/list");
// Create an array of resources
const resources = data.map((resource) => {
id: resource.id, // This ID should always refer to the same piece of media
name: resource.author || resource.id,
url: resource.download_url,
url: resource.download_url,
contentType: "image/jpeg",
// Respond with the resources
app.listen(process.env.PORT || 3000);