Add REST API support

This commit is contained in:
Wim
2017-02-18 23:10:22 +01:00
parent 930b639cc9
commit 73f01ad8d8
7 changed files with 146 additions and 7 deletions

View File

@@ -486,6 +486,28 @@ RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
#OPTIONAL (default false)
ShowJoinPart=false
###################################################################
#API
###################################################################
[api]
#You can configure multiple API hooks
#In this example we use [api.local]
#REQUIRED
[api.local]
#Address to listen on for API
#REQUIRED
BindAddress="127.0.0.1:4242"
#Amount of messages to keep in memory
Buffer=1000
#RemoteNickFormat defines how remote users appear on this bridge
#The string "{NICK}" (case sensitive) will be replaced by the actual nick / username.
#The string "{BRIDGE}" (case sensitive) will be replaced by the sending bridge
#The string "{PROTOCOL}" (case sensitive) will be replaced by the protocol used by the bridge
#OPTIONAL (default empty)
RemoteNickFormat="{NICK}"
###################################################################
#General configuration
@@ -572,6 +594,13 @@ enable=true
#OPTIONAL - your irc channel key
key="yourkey"
#API example
#[[gateway.inout]]
#account="api.local"
#channel="api"
#To send data to the api:
#curl -XPOST -H 'Content-Type: application/json' -d '{"text":"test","username":"randomuser"}' http://localhost:4242/api/message
#If you want to do a 1:1 mapping between protocols where the channelnames are the same
#e.g. slack and mattermost you can use the samechannelgateway configuration
#the example configuration below send messages from channel testing on mattermost to