Demonstrate data persistence in the demo example
Description
I recently tested a modified version of the demo on Heroku and everything worked fine until I re-deployed. I suspect seeing the message No authorization found for this team. Did you install this app again after restarting? in the logs means the authorizations are not persisted.
https://github.com/slackapi/node-slack-events-api/blob/d411e4703b6cb6df6e86ebcefa8dcfab875943e5/examples/greet-and-react/index.js#L16
What type of issue is this? (place an x in one of the [ ])
- [ ] bug
- [ ] enhancement (feature request)
- [ ] question
- [x] documentation related
- [ ] testing related
- [ ] discussion
Requirements (place an x in each of the [ ])
- [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
- [x] I've read and agree to the Code of Conduct.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
@slack/events-api version: 2.1.0
node version: 6.11.0
OS version(s): Heroku
Steps to reproduce:
- Deploy the demo app to Heroku
- Authenticate
- Redeploy
- See No authorization found for this team. Did you install this app again after restarting?
Expected result:
I think it'd be very useful to show an example of how to persist data in the provided demo.
I agree, this would be a useful example! If someone is wants to duplicate the example and add a version with persistence, the maintainers would accept the contribution.
@aoberoi I've added Local Storage for persistence, with the obvious disclaimer that it's for demo purposes only as it's not secure. But this will allow those getting started to fiddle with the code without having to re-authorize continuously.
I think it's good to include it in the current example rather than duplicate it, as it would be confusing to have two examples; one with and one without proper token storage. Different examples should probably showcase different abilities of the node-slack-events-api instead.
What do you think? Is that alright?
done and done. thanks again @ErwinLengkeek