message relay center build on openresty
location ~ ^/app/([-_a-zA-Z0-9/]+) {
content_by_lua_file conf/app_$1.lua;
}
curl -d "$json" http://xxx.com/app/message?type=message&do=set&token=xxx&md5_id=xxx
{
"time":1449024499,
"nickname":"github",
"content":"what's up man!",
"icon":"http://xxx.jpg",
"redirect":"http://xxx",
"type":"0"
}
message relay service should be use INTERNALLY, need to be wrapped by another api service for adding extra activity, such as token verification or push service etc.
curl http://xxx.com/app/message?type=message&do=get&token=xxx[&key=admins]
{
"md5_id":"5f8831aa46c5a6989ffbff1132430812",
"time":1449024499,
"nickname":"github",
"content":"what's up man!",
"icon":"http://xxx.jpg",
"redirect":"http://xxx",
"type":"0"
}
add [&key=admins] for admin message fetch, eq "admins" in msg_do.lua.
curl -d "$json" http://xxx.com/app/message?type=blacklist&do=set&token=xxx&md5_id=xxx
{
"nickname":"github",
"icon":"http://xxx.jpg",
}
curl http://xxx.com/app/message?type=blacklist&do=get&token=xxx
[{
"md5_id":"5f8831aa46c5a6989ffbff1132430812",
"nickname":"github",
"icon":"http://xxx.jpg",
}]
curl http://xxx.com/app/message?type=blacklist&do=del&token=xxx&md5_id=xxx