Lambda function that synchronize Victorian Government Emergency Fire Forecast Data to ArcGIS.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
In every xx hours, this lambda function will call an API provided by Victorian Government. This API provides the details of a single environment monitoring site with current fire ban advice for the next 5 days of data.
The app can be deploy as standalone NodeJS web app or as a AWS lambda function. To deploy to AWS Lambda, use Serverless
npm install
For this code to work, you need to
add and
register an app in ArcGIS Online,
add the correct redirect URI (e.g. http://localhost:8080), and add the client ID and secret to /routes/routes.js.
- How to add an app in ArcGIS Online
- How to register an app in ArcGIS Online
- Make sure to set the correct redirect URI (e.g.
http://localhost:8080)
Finally, update /routes/routes.js to contain your client ID and secret (and portal URL if not ArcGIS Online):
const client_id = 'xx';
const client_secret = 'xx';Update the feature server URL
const featureServerUrl = 'xx';Update the feature server URLs needed to update the time extent cache (optional)
const fsUrlsForTimeExtentCacheUpdate = ['xx', 'xx'];sls deploy
sls offline start
sls invoke -f app
Comment out the Serverless handle and uncomment the local server part in /index.js
// module.exports.handler = serverless(app);
// USE THIS FOR LOCAL SERVER
var server = app.listen(3000, function() {
console.log('app running on port.', server.address().port);
});- Ho Xin Jun - Initial work
This project is licensed under the MIT License - see the LICENSE.md file for details