Skip to content

Fix normalizePort and consolidate delete handlers - #136

Merged
thehabes merged 5 commits into
mainfrom
cubap-fix-normalizeport-and-delete-routes
Oct 26, 2026
Merged

thehabes merged 5 commits into
mainfrom
cubap-fix-normalizeport-and-delete-routes

Conversation

@cubap

@cubap cubap commented Oct 13, 2026

Copy link
Copy Markdown
Member

This PR addresses two related issues:

  • tinyNode.js normalizePort() is not doing okay #52 tinyNode.js normalizePort() is not doing okay

    • Moves the default port outside the normalizePort() call: const port = normalizePort(process.env.PORT) || 3002
    • Updates normalizePort() to validate that the value is an integer between 1 and 65535, returning false otherwise so .listen() always receives a number.
  • Remove double DELETE handling #64 Remove double DELETE handling

    • Consolidates the two router.delete() handlers in routes/delete.js into a single deleteRecord handler that extracts the @id from either the path parameter or the request body and performs the delete.

Fixes #52
Fixes #64

- Normalize port to a valid integer 1-65535, defaulting to 3002 outside the call.
- Consolidate the two DELETE handlers in routes/delete.js into a single deleteRecord handler.

Fixes #52, fixes #64

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@cubap
cubap requested a review from thehabes as a code owner October 13, 2026 18:28
@cubap
cubap deployed to development October 13, 2026 18:29 — with GitHub Actions Active
thehabes

This comment was marked as resolved.

@thehabes
thehabes deployed to development October 26, 2026 16:15 — with GitHub Actions Active
@thehabes
thehabes deployed to development October 26, 2026 16:26 — with GitHub Actions Active
@thehabes
thehabes self-requested a review October 26, 2026 16:32

@thehabes thehabes left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes tested and successful. TinyNode itself will always call to RERUM using the "/delete/{_id}" pattern.

@thehabes
thehabes deployed to development October 26, 2026 16:34 — with GitHub Actions Active
@thehabes
thehabes merged commit 3f2c67f into main Oct 26, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
development — 68071664 Deployed Oct 26, 2026 by thehabes via deploy (24, vlcdhp02) #214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove double DELETE handling tinyNode.js normalizePort() is not doing okay

2 participants