Replace axios with native fetch in webhook utils #1

Open
Michilis wants to merge 1 commits from claude/epic-nobel-5d1572 into main
Owner

What

Replaces the axios dependency with Node's built-in fetch in the two webhook utilities:

  • src/utils/message.js
  • src/utils/webhook.js

Why

axios was required by both files but was never declared in package.json, so npm install never installed it and the app crashed on startup:

Error: Cannot find module 'axios'
  at .../src/utils/message.js:1

Rather than add the missing dependency, both webhook POST calls now use Node's built-in fetch (available since Node 18; this project runs on 22.12), dropping the dependency entirely.

Notes for reviewer

  • Behavior preserved: JSON body + Content-Type: application/json header.
  • An explicit response.ok check reproduces axios's throw-on-non-2xx semantics (fetch does not throw on HTTP errors).
  • message.js previously returned response.data; it now returns parsed JSON, with a text fallback when the webhook does not respond with JSON.
  • No remaining references to axios in the codebase.

🤖 Generated with Claude Code

## What Replaces the `axios` dependency with Node's built-in `fetch` in the two webhook utilities: - `src/utils/message.js` - `src/utils/webhook.js` ## Why `axios` was `require`d by both files but was **never declared in `package.json`**, so `npm install` never installed it and the app crashed on startup: ``` Error: Cannot find module 'axios' at .../src/utils/message.js:1 ``` Rather than add the missing dependency, both webhook POST calls now use Node's built-in `fetch` (available since Node 18; this project runs on 22.12), dropping the dependency entirely. ## Notes for reviewer - Behavior preserved: JSON body + `Content-Type: application/json` header. - An explicit `response.ok` check reproduces axios's throw-on-non-2xx semantics (`fetch` does not throw on HTTP errors). - `message.js` previously returned `response.data`; it now returns parsed JSON, with a text fallback when the webhook does not respond with JSON. - No remaining references to axios in the codebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Michilis added 1 commit 2026-06-26 22:32:20 +00:00
axios was required by src/utils/message.js and src/utils/webhook.js but was
never declared in package.json, so `npm install` never fetched it and the app
crashed on startup with MODULE_NOT_FOUND.

Switch both webhook POST calls to Node's built-in fetch (available since
Node 18; running on 22.12), removing the missing dependency entirely.
Behavior is preserved: JSON body with Content-Type header, and an explicit
response.ok check to keep axios's throw-on-non-2xx semantics. message.js now
returns parsed JSON (or text fallback) in place of axios's response.data.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/epic-nobel-5d1572:claude/epic-nobel-5d1572
git checkout claude/epic-nobel-5d1572
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Michilis/Nostr-post-scheduler#1