Simple API - receives as an input an integer number
URL: http://localhost:3000/input/:number
- Given a web endpoint "/GET", create an API that will receive as an input an integer number.
- If the integer is a multiple of 3, it should return "P",
- If the integer is a multiple of 5, it should return "E",
- If the integer is a multiple of both 3 and 5, then both "PE" should be displayed. otherwise the provided integer should be returned.
- If the value sent is not an integer return an appropriate response
- The output of the API should be in JSON.
curl http://localhost:3000/input/300
Idempotent result: {"outcome":"PE","requested":"300","message":"Success! You have provided number: 300"}
curl http://localhost:3000/input/0
Idempotent result: {"outcome":"PE","requested":"0","message":"Success! You have provided number: 0"}
Availability test
culr http://localhost:3000/ping
Idempotent result: {"message":"ping > pong"}
You can call as well
culr http://localhost:3000
Redirecting to /input