Skip to content

zzBrunoBrito/MassTimeApi

Repository files navigation

Hi, the main file is handler.js, masstime_api.js and helper.js are functions i used to complete the task
I'm using axios to make http requests
The errors messages from MassTimes api are returned to the client as required and i'm also returning headers, so browser or any
kind of client can use content-type header to render correctly the response(masstimes api sometimes returns html when there are errors)
If the server doesn't respond, a error is returned as well
I also added a serverless.yml file and configured it to expose this lambda as GET http endpoint
If you need to deploy it you can upload the files as .zip or just run "sls deploy" if serverless framework is already installed
To run it locally you can uncomment the lines 32-41 of handler.js or if you have serverless framework installed:
sls invoke local --function get_churches

* Despite being a relatively simple task to complete, may it could be solved with a single file and no external dependencies(axios),
I tried to use a bit more complex solution to show things like lambda management with serverless framework,
consuming libs, error handling and simpler things like check if a value exists before manipulate it
so the code don't break when there are null values, for instance.

** I also deployed this lambda on my personal aws account, I'll keep it there for some days, if you need can access like this:
https://oe7rq83jzb.execute-api.us-east-1.amazonaws.com/dev/churches?lat=45.419&long=-80.674&pg=1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published