An application to determine the type of a polygon. For example, to determine whenever a triangle is equilateral, isosceles or scalene.
- Navigate to
Application
class and press the play button from IntelliJ. - Or run the gradle task:
./gradlew bootRun
. (NOTE: If you are gettingunresolved reference error
, check this post.)
curl -X POST \
http://localhost:8080/v1/categorize \
-H 'Content-Type: application/json' \
-d '[3,4,5]'
It is a POST request to /v1/categorize
endpoint which must include in the body of request a payload containing a list of integers representing the sides of the polygon.
It should return a json containing the shape
and the type
.
- Request:
curl -X POST \
http://localhost:8080/v1/categorize \
-H 'Content-Type: application/json' \
-d '[5,5,5]'
- Response:
{"shape":"Triangle","type":"Equilateral"}