Description
The NodeJS integration kit in its current state fails to start on modern Node.js environments due to two critical issues:
1. Deprecated bodyParser() call crashes the server
In main.js, the middleware is initialized as:
This form was removed in body-parser v2+ and deprecated long before that. It throws a TypeError: bodyParser is not a function or similar error, preventing the server from starting.
Fix: Replace with the explicit middleware calls:
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
2. Missing dependencies in package.json
express and body-parser are required in main.js but were never listed in package.json. Running npm install from a clean clone does not install them, causing require() to fail.
3. No .gitignore
node_modules/ and .env (which contains secrets like EASEBUZZ_KEY and EASEBUZZ_SALT) have no .gitignore entry, risking accidental commit of sensitive data and bloating the repo.
Steps to Reproduce
- Clone the repo
cd Easebuzz_NodeJS_kit && npm install
node main.js
- Server crashes immediately
Expected Behavior
Server starts and listens on port 3000.
Description
The NodeJS integration kit in its current state fails to start on modern Node.js environments due to two critical issues:
1. Deprecated
bodyParser()call crashes the serverIn
main.js, the middleware is initialized as:This form was removed in
body-parserv2+ and deprecated long before that. It throws aTypeError: bodyParser is not a functionor similar error, preventing the server from starting.Fix: Replace with the explicit middleware calls:
2. Missing dependencies in
package.jsonexpressandbody-parserare required inmain.jsbut were never listed inpackage.json. Runningnpm installfrom a clean clone does not install them, causingrequire()to fail.3. No
.gitignorenode_modules/and.env(which contains secrets likeEASEBUZZ_KEYandEASEBUZZ_SALT) have no.gitignoreentry, risking accidental commit of sensitive data and bloating the repo.Steps to Reproduce
cd Easebuzz_NodeJS_kit && npm installnode main.jsExpected Behavior
Server starts and listens on port 3000.