chih-chen / polydator

Simple clean architecture application to determine the type of a polygon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Polydator

An application to determine the type of a polygon. For example, to determine whenever a triangle is equilateral, isosceles or scalene.

How to start the server

  • Navigate to Application class and press the play button from IntelliJ.
  • Or run the gradle task: ./gradlew bootRun. (NOTE: If you are getting unresolved reference error, check this post.)

How to make a request

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.

Example

  • Request:
curl -X POST \
  http://localhost:8080/v1/categorize \
  -H 'Content-Type: application/json' \
  -d '[5,5,5]'
  • Response:
{"shape":"Triangle","type":"Equilateral"}

About

Simple clean architecture application to determine the type of a polygon


Languages

Language:Kotlin 100.0%