REST API server that calculates years that have the same calendar.
go get -u github.com/lakhanmankani/same-calendar-api
Request:
curl -X POST localhost:8080/api/register
Response:
{
"key": "9842824a468b7e0a1a01c9d802eb164c568ce3d86c1b7cfa0b80a7eab0379f3e"
}
Request:
curl -X GET localhost:8080/api/same-calendar?key=<apikey>&year=2020&n=5&forward=true
Response:
{
"years": [2020,2048,2076,2116,2144]
}
Request:
curl -X GET localhost:8080/api/same-calendar?key=<apikey>&year=2020&n=5&forward=false
Response:
{
"years": [2020,1992,1964,1936,1908]
}
Request:
curl -X DELETE localhost:8080/api/unregister?key=<apikey>