Giter VIP home page Giter VIP logo

krishan---carinsuranceapi's Introduction

Car Insurance API

This is a simple Express.js application that provides APIs for calculating car value.

Technologies Used

  • TypeScript
  • Node.js
  • Express.js
  • Mocha (for testing)
  • Chai (for assertions in testing)
  • Axios (for making HTTP requests)
  • Body-parser (for parsing request bodies)

Setup

To get started, follow these steps:

  1. Install Node.js

  2. Clone this repository to your local machine:

    git clone https://github.com/kriraw14/CarInsuranceAPI
    
  3. Navigate to the project directory:

    cd CarInsuranceAPI
    
  4. Install project dependencies:

    npm install
    
  5. 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.

API Endpoints

1. Calculate Car Value

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)

Running the Server

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.

Running the Test

You can run the test using the following command:

npm test

Test screenshot

krishan---carinsuranceapi's People

Contributors

kriraw14 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.