Problem
The repository contains backend tests, but npm test does not run them and server.js cannot be imported cleanly.
Current Behavior
npm test exits with the default placeholder error. Existing tests expect a createApp factory, but the backend starts immediately and exports nothing.
Why This Improvement Is Needed
Maintainers cannot verify backend behavior before merging API changes. This increases regression risk for URL scanning, scam detection, retry handling, and error responses.
Proposed Solution
Refactor server.js to expose createApp(options), keep direct node server.js startup behavior, and wire npm test to Node's built-in test runner.
Expected Outcome
Backend routes can be tested deterministically with injected API keys and mock fetch implementations.
Additional Notes
This keeps runtime compatibility while making the backend maintainable.
Problem
The repository contains backend tests, but
npm testdoes not run them andserver.jscannot be imported cleanly.Current Behavior
npm testexits with the default placeholder error. Existing tests expect acreateAppfactory, but the backend starts immediately and exports nothing.Why This Improvement Is Needed
Maintainers cannot verify backend behavior before merging API changes. This increases regression risk for URL scanning, scam detection, retry handling, and error responses.
Proposed Solution
Refactor
server.jsto exposecreateApp(options), keep directnode server.jsstartup behavior, and wirenpm testto Node's built-in test runner.Expected Outcome
Backend routes can be tested deterministically with injected API keys and mock fetch implementations.
Additional Notes
This keeps runtime compatibility while making the backend maintainable.