This is an example of creating a function that runs as a cron job using the serverless schedule
event. It retrieves weather information every hour and stores it in a DynomDB Database. For more information on schedule
event check out the Serverless docs on schedule.
Read the AWS cron expression syntax docs for more info on how to setup cron
Please visit https://openweathermap.org to register for a free API token.
Upon setting up access to both external services, you'll be required to update the environment variables in serverless.yml
:
environment:
WEATHER_APPID: cbf3242865fa6678c01628ab8938d7 <your own WeatherId>
In order to deploy the you endpoint simply run
serverless deploy