BMI calculation (API only)
BMI calculation endpoint: api/calculate-bmi
POST
Request body sample
[
{"Gender": "Male", "HeightCm": 171, "WeightKg": 96 },
{"Gender": "Male", "HeightCm": 161, "WeightKg":80 }
]
Response Sample
{
"success": true,
"message": "BMI calculated",
"data": {
"Person": [
{"Gender": "Male", "HeightCm": 171, "WeightKg": 96, "BMI": 32.8, "Category": "Moderately obese", "HealthRisk": "Medium risk" },
{"Gender": "Male", "HeightCm": 161, "WeightKg":80, "BMI": 30.9, "Category": "Moderately obese", "HealthRisk": "Medium risk" }
],
"totalOverweight": 2
}
}
Full Url of calculate bmi API https://code-20210915-rajeshdan.herokuapp.com/api/calculate-bmi
$ yarn install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
e2e testing added up-to 1000 input