This commit is contained in:
Kfir Dayan 2023-07-09 11:09:57 +03:00
parent 46f78fa563
commit 8497091309
3 changed files with 23 additions and 3 deletions

20
todo-service/Dockerfile Normal file
View file

@ -0,0 +1,20 @@
# Use the official Node.js 14 image as the base
FROM node:14
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the container
COPY package*.json ./
# Install project dependencies
RUN npm install
# Copy the rest of the application code to the container
COPY . .
# Expose the port on which your Express app listens
EXPOSE 3000
# Start the application in development mode
CMD ["npm", "run", "dev"]

View file

@ -4,7 +4,7 @@
"description": "",
"main": "main.js",
"scripts": {
"dev": "nodemon dist/main.js"
"dev": "node dist/main.js"
},
"keywords": [],
"author": "",

View file

@ -58,7 +58,7 @@ export class RabbitMQ {
headers: { "x-delay": delayTimeForQueue },
};
try {
await this.channel.publish(
this.channel.publish(
this.exchange,
this.queue,
Buffer.from(message),
@ -73,6 +73,6 @@ export class RabbitMQ {
calculateDelayTimeForQueue(payload: ITodo) {
const delayTime = payload.due_date.getTime() - Date.now();
return 0;
return delayTime;
}
}