mortgage-rates-service
API for Canadian Bank Mortgage Rates
Design
- Restful end-point using Node.js with express.js, restify, or hapi
- Hosting will be on AWS Lambda and API Gateway
- All logs to stdout using console.log, console.error and etc. to be captured by CloudWatch Logs automatically
Sample Request #1
GET /
Sample Response #1
{
"mortgages": [
{
"provider": "Canadian Lender",
"rates": [
{
"type": "5-years-fixed",
"rate": 2.45,
"comment": "Prime - 1.25"
},
{
"type": "3-years-fixed",
"rate": 3.34
},
... more rates ...
]
},
{
"provider": "Peoples Trust",
"rates": [
{
"type": "5-years-fixed",
"rate": 2.50,
"comment": "Prime - 1.20"
},
{
"type": "3-years-fixed",
"rate": 3.39
},
... more rates ...
]
},
... more providers ...
]
}
Sample Request #2
GET /Canadian%20Lender
Sample Response #2
{
"mortgages": [
{
"provider": "Canadian Lender",
"rates": [
{
"type": "5-years-fixed",
"rate": 2.45,
"comment": "Prime - 1.25"
},
{
"type": "3-years-fixed",
"rate": 3.34
},
... more rates ...
]
}
]
}
Source Data
https://www.ratehub.ca/banks/bank-mortgage-rates loaded and parsed in real-time
Development Setup
- Clone the repository
- Install dependencies from the repository root folder using terminal window:
npm install
- To run unit tests from a terminal window:
npm test
Deployment
- Initialize aws-cli:
aws configure
- Create lambda:
chmod +x ./aws/*.sh && ./aws/create-lambda.sh mortgage-rate-service
- Create api-gateway:
sudo python3.6 -m pip install boto3 \
&& python3.6 ./aws/create-api.py mortgage-rate-service
How to contribute
- Fork the repo
- Make changes and commit to your own repository
- Submit a pull request back into this repository