Compare commits

..

2 Commits

Author SHA1 Message Date
Norbert Maciaszek
bcb7ae01b3 fix: install npm Dockerfile 2025-11-27 23:14:13 +01:00
Norbert Maciaszek
11f120ce2f feat: Introduce Dockerization and shift product data sourcing from external API to local files. 2025-11-27 23:02:01 +01:00
2 changed files with 17 additions and 6 deletions

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM node:22-slim
WORKDIR /app
COPY package*.json .
RUN npm install
RUN npx playwright install-deps
RUN npx playwright install chromium
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() {