This project is the backend server for the Commission Calculator Application. It is built using Node.js and Express.js to handle API requests related to calcualtions.
- Provides endpoints for calculating commissions based on input values such as sales amount and commission rate.
- Implements RESTful API design for easy integration with frontend applications.
- Utilizes Node.js and Express.js for efficient and scalable server-side development.
- Node.js: A JavaScript runtime environment for server-side development.
- Express.js: A web application framework for Node.js, providing robust features for building APIs.
- JavaScript: The primary programming language used for backend development.
-
Start the server:
node app.js
-
The server will be running on http://localhost:3001 by default.
-
Use API endpoints to perform commission calculations.
-
GET /policy: Retrieve all policy settings.
- Response:
{ "success": true, "message": "Data fetched successfully.", "items": [Array of policy objects] }
- Response:
-
POST /policy: Create a new policy setting.
- Request Body:
{ "property": "value" }
- Response:
{ "success": true, "message": "Policy setting created successfully.", "item": { "created_policy_object" } }
- Request Body:
-
PUT /policy/:id: Update an existing policy setting by ID.
- Request Body:
{ "property": "new_value" }
- Response:
{ "success": true, "message": "Policy setting updated successfully.", "item": { "updated_policy_object" } }
- Request Body:
-
DELETE /policy/:id: Delete a policy setting by ID.
- Response:
{ "success": true, "message": "Policy setting deleted successfully." }
- Response: