API For Finding the Public Bank Holidays within the UK, England region. Built using the serverless framework, this produces a cloudformation template for automated deployment to AWS Lambda and API gateway on your own AWS account.
/holidays/{bankHolidayAPIIdentifier}/{year}
Bank Holiday | bankHolidayAPIIdentifier |
---|---|
Easter Mon | eastermon |
Good Friday | goodfri |
Christmas | christmasbankhol |
Boxing Day | boxingdaybankhol |
New Years Day | newyearsbankhol |
May Day | maydaybankhol |
Spring | springbankhol |
Summer | summerbankhol |
Day | bankHolidayAPIIdentifier |
---|---|
Easter Sunday | eastersun |
Example:
/holidays/eastermon/2017
The API is deployed and publicaly avalible at:
https://holidayapi.robertcurran.uk/holidays/goodfri/2019
https://holidayapi.robertcurran.uk/version
Base URL:
https://holidayapi.robertcurran.uk/
This uses the serverless framework along with Express, all of the bank holiday API endpoints are handled by the same lambda function, the lambda via the use of Express handles the routing to the appropiate handler for any given call to the API.
Made this because I could not find the UK bank holidays as an API call without paying a stupendous amount.
To Test the lambda function localy with the web API utilise the serverless framework and execute the following after git cloning:
npm install
serverless offline start
I have created a docker image that exposes the API on port 3000, this is avalible at:
https://hub.docker.com/r/ro5635/holidaysapi/
This can be aquired and executed using the following docker command:
docker run --rm -p {localMachinePort}:3000 ro5635/holidaysapi
Mocha tests have been compleated using the bank holidays dates provided on the UK goverment website, these can be found in the test directory. All commits to the master branch are ran through the CI system, CircleCI. The CI system automaticaly builds on commit and runs all of the mocha tests.
:squirrel: