itssinghankit / 2100270100024

test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DEVELOP AVERAGE CALCULATOR MICROSERVICE

DESCRIPTION

This app takes numberid parameter from user and based on the value provided, it gives average of all the numbers present in the array.

The numberid can be

  1. p for prime numbers
  2. e for even numbers
  3. f for fibonacci numbers
  4. r for random numbers

To see the response, hit the GET Api with numberid as parameter for e.g. let's assume out project is hosted locally at port 3000, then

http://localhost:3000/api/v1/numbers/e

NOTE :- It will only work if Access token is valid, so before making the request you need to update Authorization header in .env file

SOME INSIGHTS OF PROJECT

  • It uses MVC Architecture pattern for its implementation making it scalable.
  • It uses Axios for making network request from server to another server.
  • It uses Http-errors module for throwing Errors.
  • Uses Modern Coding Methodology.

DEPENDENCIES USED

  • axios
  • cors
  • dotenv
  • express
  • http-errors
  • mongoose

SCREENSHOTS

When there is no data stored in mongodb database

Screenshot (4542)

Making Request for first time

Screenshot (4543)

NOTE :- windowPrevState Array is Empty.

MongoDB database screenshot

Screenshot (4544)

Making Request for second time

Screenshot (4545)

MongoDB database screenshot

Screenshot (4546)

About

test


Languages

Language:JavaScript 100.0%