Skip to content

Commit

Permalink
Modify history port (#90)
Browse files Browse the repository at this point in the history
The chat service is embedded within collaboration. Let's modify history to use port 8085 instead
  • Loading branch information
samuelim01 authored Nov 12, 2024
1 parent 952b613 commit 82f1389
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ docker compose -f compose.yml -f compose.dev.yml up -d
| User Service | 8082 |
| Match Service | 8083 |
| Collaboration & Room Service | 8084 |
| Chat Service | 8085 |
| History Service | 8086 |
| History Service | 8085 |

**Step 4: Stop the Docker containers**

Expand Down
2 changes: 1 addition & 1 deletion compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ services:
history:
command: npm run dev
ports:
- 8086:8086
- 8085:8085
volumes:
- /app/node_modules
- ./services/history:/app
Expand Down
2 changes: 1 addition & 1 deletion nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ upstream collaboration-api {
}

upstream history-api {
server history:8086;
server history:8085;
}

server {
Expand Down
2 changes: 1 addition & 1 deletion services/history/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ DB_CLOUD_URI=<FILL-THIS-IN>
DB_LOCAL_URI=mongodb://history-db:27017/history
BROKER_URL=amqp://broker:5672
CORS_ORIGIN=*
PORT=8086
PORT=8085
JWT_SECRET=you-can-replace-this-with-your-own-secret
NODE_ENV=development
2 changes: 1 addition & 1 deletion services/history/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
EXPOSE 8086
EXPOSE 8085

CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion services/history/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ docker compose down -v

- This endpoint retrieves the history of a user.
- **HTTP Method**: `GET`
- **Endpoint**: http://localhost:8086/api/history/history
- **Endpoint**: http://localhost:8085/api/history/history
- **Headers**
- `Authorization: Bearer <JWT_ACCESS_TOKEN>` (Required)
- The endpoint requires the user to include a JWT (JSON Web Token) in the HTTP Request Header for authentication and authorization. This token is generated during the authentication process (i.e., login) and contains information about the user's identity. The server verifies this token to ensure that the client is authorized to access the data.
Expand Down
2 changes: 1 addition & 1 deletion services/history/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const envSchema = z
NODE_ENV: z.enum(['development', 'production']).default('development'),
CORS_ORIGIN: z.union([z.string().url(), z.literal('*')]).default('*'),
JWT_SECRET: z.string().trim().min(32),
PORT: z.coerce.number().min(1024).default(8086),
PORT: z.coerce.number().min(1024).default(8085),
})
.superRefine((data, ctx) => {
const isUrl = z.string().url();
Expand Down

0 comments on commit 82f1389

Please sign in to comment.