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)
- Host: GitHub
- URL: https://github.com/mdecker-mobilecomputing/nodejs_express_bmi
- Owner: MDecker-MobileComputing
- License: bsd-3-clause
- Created: 2024-01-27T11:01:27.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-16T17:18:11.000Z (4 months ago)
- Last Synced: 2025-02-16T18:26:08.363Z (4 months ago)
- Topics: body-mass-index, express-js, github-actions, nodejs, rest-api
- Language: JavaScript
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.