Skip to content

Commit

Permalink
Merge pull request #4 from ibrahim-nazari/main
Browse files Browse the repository at this point in the history
added log to check format of data
  • Loading branch information
ibrahim-nazari authored Aug 23, 2024
2 parents 03b0f3a + 10e2be5 commit 1c8cc52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ app.post("/", async (req, res) => {
const url = makeUrl(req.body);
const response = await axios.get(url);
getPreviewFromContent({ ...response, url }).then(async (data) => {
console.log("data ---", data);

let newData = data;
const imagesource = data?.images[0] || null;
if (imagesource) {
Expand All @@ -61,6 +63,7 @@ app.post("/", async (req, res) => {
const videoId = youtube_parser(url);
newData = { ...newData, videoId };
}
console.log("newData ---", newData);
return res.status(200).json(newData);
});
} catch (error) {
Expand Down

0 comments on commit 1c8cc52

Please sign in to comment.