Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/backend/src/loaders/environment.loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ config();

export const environment = {
MONGO_URL: process.env.MONGO_URL,
PORT: process.env.PORT ?? 3000,
PORT: process.env.PORT || 8080,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Validate and convert PORT by implementing an inline function that checks if the numeric value is valid, ensuring a fallback to 8080 per the reverted business logic. [Security Configuration]

Suggested change
PORT: process.env.PORT || 8080,
PORT: (() => {
const port = parseInt(process.env.PORT, 10);
return (Number.isNaN(port) || port <= 0 || port > 65535) ? 8080 : port;
})(),

JWT_ISSUER: process.env.JWT_ISSUER,
JWT_SECRET: process.env.JWT_SECRET,
JWT_AUDIENCE: process.env.JWT_AUDIENCE,
Expand Down
Loading