-
-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RESTful web server and webhook parser #96
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jacobtomlinson
force-pushed
the
aiohttp-server
branch
from
February 4, 2017 11:56
d1b6fbf
to
73a0b39
Compare
1 similar comment
1 similar comment
1 similar comment
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a web server to opsdroid. The two main uses of this will be adding a RESTful web server for querying things like stats for monitoring and also a new matcher for webhooks to specific urls.
Web server and RESTful API
There are currently two methods implemented:
/
returns a welcome message to opsdroid/stats/
returns a dictionary of metrics for opsdroid including messages parsedThere are new optional config items for specifying the server host and port numbers.
webhook parser
A new matcher
match_webhook
has been added which will cause a skill to be executed when an API endpoint receives a request. The API will return a success message if a skill is triggered but no information on the skill's execution as it happens asynchronously.Methods will be added dynamically at load time and follow this format:
/skill/{skillname}/{webhookname}/
example skill
example config
To trigger this skill make a request to
http://localhost:8080/skill/testskill/testhook
. The response body will look like: