Skip to content

tech2pandas/SquareNumber-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Square Demo

This is a simple Spring Boot Project which exposes an endpoint to square a number.

Sample Example with endpoint

Request:

GET http://ec2-35-164-116-43.us-west-2.compute.amazonaws.com:8080/square/10

Response:
{
"data": 100
}

Change 10 to any number.

Input Validation

However if the given number is not an integer(i.e., it is a string or a double), then you will get an error response like this

Request:

GET http://ec2-35-164-116-43.us-west-2.compute.amazonaws.com:8080/square/ten

Response:
{
"error": "Error while parsing input. Make sure the input is an integer"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages