A simple Node.js and Express API for calculating simple and compound interest.
- Calculates simple interest and total amount.
- Calculates compound interest and total amount.
- Includes input validation for all parameters.
- Displays final result along side inputs rendered.
-
Clone the repository:
git clone https://github.com/HafeezShuaib/InterestCalculatorAPI.git cd InterestCalculatorAPI -
Installing dependencies: This will install
express,morganandnodemonas listed inpackage.json:npm install
-
This will use
nodemonto automatically restart the server when you make changes to the files:nodemon app.js
This will run the application using node:
node app.js
Once running, the server will be available at http://localhost:3000.
-
This API provides two (2) endpoints for calculations:
POST /api/calculate/simple-interest POST /api/calculate/compound-interest
For detailed information on request/response formats, please see the full API Documentation.