From 11f120ce2fc0e5daa549eb4f7f7f70aa000613b4 Mon Sep 17 00:00:00 2001 From: Norbert Maciaszek Date: Thu, 27 Nov 2025 23:02:01 +0100 Subject: [PATCH] feat: Introduce Dockerization and shift product data sourcing from external API to local files. --- Dockerfile | 7 +++++++ index.js | 9 +++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..177b743 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:22-alpine + +WORKDIR /app + +COPY . . + +CMD ["node", "index.js"] \ No newline at end of file diff --git a/index.js b/index.js index 7d0f8e1..1bf0bc8 100644 --- a/index.js +++ b/index.js @@ -60,13 +60,10 @@ async function compareAndSave(productsPrice) { } async function getProducts() { - const products = await axios - .get( - "https://db.maciaszek.ovh/api/collections/gifts_items/records?fields=ceneo_id&filter=ceneo_id!=''" - ) - .then((response) => response.data.items.map((item) => item.ceneo_id)); + const products = fs.readFileSync("input.txt", "utf8"); + const productsIds = products.split("\n"); - return products; + return productsIds; } async function init() {