This is a simple Express.js application that provides APIs for calculating car value.
- TypeScript
- Node.js
- Express.js
- Mocha (for testing)
- Chai (for assertions in testing)
- Axios (for making HTTP requests)
- Body-parser (for parsing request bodies)
To get started, follow these steps:
-
Install Node.js
-
Clone this repository to your local machine:
git clone https://github.com/kriraw14/CarInsuranceAPI
-
Navigate to the project directory:
cd CarInsuranceAPI
-
Install project dependencies:
npm install
-
Start the server:
npm start
By default, the server runs on port 5000, but you can modify the port
variable in server.js
to change it.
Endpoint: POST /carvalue
Calculates the value of a car based on its model and year.
Request body should be a JSON object with the following properties:
model
: The model of the car (string)year
: The year the car was made (number)
You can start the server using the following command:
npm start
Remember that the server, by default, runs on port 5000. If you want to change the port, you can do so by modifying the port
variable in index.ts
.
You can run the test using the following command:
npm test