Update README, clarify license, reorganize project structure, and add WhatsApp Cloud API stub #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: Please don't merge yet on my behalf. Like a diff, I may make a few final tweaks.
Changes the license to vanilla MIT
The previously license conflated terms of service with the license and will (from my past corporate OSS experience) make the project more difficult for companies to use – if it's not precisely using one of the well-known approved licenses, then the developer's Legal team might need to look at it, adding friction.
Since FB developers need to accept the ToS to create an account and use platforms anyway, this did not seem to add value, and rather subtracted value.
Updated the
README.md
to reflect the changes in the diffCorrected minor mistakes (e.g., it was referring to the
master
branch when the primary branch ismain
). Added a reference to some Webhook examples that exist in other repositories.Reorganized folder structure
Since the repository has multiple languages, Facebook platforms, and support for deploying to cloud platforms, I thought it would make sense to organize the directory structure so that people who are looking for a particular example can easily find it.
Thus I moved the existing folders into:
Added WhatsApp Cloud API Example
I added a stub of the Cloud API Webhook handler under
whatsapp-platform/nodejs/graph-api-webhook-server/
. This code was already public in our documentation without a license, and I just copied it here to begin working with it.It's been difficult for me to receive incoming Webhooks so I haven't been able to test it yet. I tried to set up an instance on AWS but ran into difficulties – the burden of requiring an HTTPS URL means I need a domain name, TLS certificate, and server listening on port 443. I was working on setting this up when I had to stop. (I tried using API Gateway to provide an HTTPS URL in front of a NodeJS server running on EC2, but couldn't get the full system working for inexplicable reasons.)
I'd also like to change the behavior of the existing program from being an echo-bot to being one that provides a callback structure internal for each event type, which in the example is implemented by simply printing the event to the console. This way the developer could easily copy the example and start replacing the event callbacks with their own code.
The current example is an echo-bot, and while that would be a useful example too, my original goal was to build a skeleton that makes it easier to handle event types by detecting their type, deserializing them (less meaningful in JavaScript; more so in other languages), and invoking an event-specific method – for as many languages I could manage.