An open API service indexing awesome lists of open source software.

https://github.com/mdecker-mobilecomputing/nodejs_express_bmi

Simple REST-API offering an endpoint for calculation of "Body Mass Index" (BMI)
https://github.com/mdecker-mobilecomputing/nodejs_express_bmi

body-mass-index express-js github-actions nodejs rest-api

Last synced: 4 months ago
JSON representation

Simple REST-API offering an endpoint for calculation of "Body Mass Index" (BMI)

Awesome Lists containing this project

README

        

# REST-API "Body Mass Index (BMI)" mit Nodejs+Express #


Einfache REST-API für [BMI-Berechnung](https://www.barmer.de/gesundheit-verstehen/leben/abnehmen-diaet/body-mass-index/bmi-rechner-1004244)
mit [Nodejs](https://nodejs.org) und [Express](https://expressjs.com).


----

## Verwendung ##


Nach Klonen/Download des Repos: `npm install`

Webserver mit REST-API starten: `npm start`


----

## Beispiele ##


Beispiel für Abfrage für 80kg Körpergewicht und 190cm Körpergröße: http://localhost:8080/bmi?kg=80&cm=190
```
{
"erfolg" : true,
"bmi" : 22.2,
"nachricht": "Normalgewicht"
}
```


Beispiel für Abfrage mit fehlender Körpergröße: http://localhost:8080/bmi?kg=80
```
{
"erfolg" : false,
"nachricht": "Bitte URL-Parameter >cm< angeben."
}
```


Beispiel für Abfrage mit fehlender Körpergröße: http://localhost:8080/bmi?kg=80&cm=asdf
```
{
"erfolg" : false,
"nachricht": "Wert \"asdf\" für URL-Parameter >cm< ist keine int-Zahl."
}
```


----

## License ##


See the [LICENSE file](LICENSE.md) for license rights and limitations (BSD 3-Clause License)
for the files in this repository.