feat: Introduce Dockerization and shift product data sourcing from external API to local files.

This commit is contained in:
Norbert Maciaszek
2025-11-27 23:02:01 +01:00
parent f09b58fb63
commit 11f120ce2f
2 changed files with 10 additions and 6 deletions

7
Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM node:22-alpine
WORKDIR /app
COPY . .
CMD ["node", "index.js"]

View File

@@ -60,13 +60,10 @@ async function compareAndSave(productsPrice) {
} }
async function getProducts() { async function getProducts() {
const products = await axios const products = fs.readFileSync("input.txt", "utf8");
.get( const productsIds = products.split("\n");
"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));
return products; return productsIds;
} }
async function init() { async function init() {