cp api/.env.example api/.env
docker build . -t cc -f Dockerfile
docker run -d -p 8081:8080 cc
Return the result of calculator for converting one currency to another
-
URL
/api/currency/convert
-
Method:
GET
-
URL Params
None
-
Query String Params
-
from:
string
(Required), original currency. UseTWD
,USD
andJPY
-
to:
string
(Required), target currency. UseTWD
,USD
andJPY
-
amount:
integer
(Required), any number larger than0
-
-
Success Response:
- Code: 200
Content:{"result" : "1,234.56"}
- Code: 200
-
Error Response:
- Code: 422 Unprocessable Entity
Content:{"error": "User doesn't exist"}
- Code: 422 Unprocessable Entity
-
Example
- URL:
http://localhost:8081/api/currency/convert?from=USD&to=TWD&amount=123456
- Response:
{"result":"3,758,494.46"}
- URL:
cd api && vendor/bin/pest --colors=always