mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 11:47:56 +08:00
17c80508c0
* Drop C++14 Support * Update README.md * Remove drogon::optional in favor of std::optional * Remove drogon::filesystem in favor of std::filesystem * Remove boost::string_view and pre-c++17 hacks * Remove boost::any * Remove the string_view.h and the any.h * Remove boost lib * Update .clang-format and ci Co-authored-by: Omar Mohamed <omar@omar-laptop.lan> Co-authored-by: Ken Matsui <26405363+ken-matsui@users.noreply.github.com> Co-authored-by: An Tao <antao2002@gmail.com> Co-authored-by: albaropereyra22 <141711575+albaropereyra22@users.noreply.github.com> Co-authored-by: Yoshihiro Hokazono <47231909+hokacci@users.noreply.github.com> Co-authored-by: Omar Mohamed Khallaf <51155980+omarmohamedkh@users.noreply.github.com> |
||
---|---|---|
.. | ||
controllers | ||
CMakeLists.txt | ||
main.cc | ||
README.md |
Redis example
A simple redis example
Usage
First of all you need redis running on the port 6379
Post
curl --location --request POST 'localhost:8080/client/foo' \
--header 'Content-Type: application/json' \
--data-raw '{
"value": "bar"
}'
Get
curl --location --request GET 'localhost:8080/client/foo'
Subscribe and Publish
Go to a websocket test website, such as https://wstool.js.org
Subscribe
Connect to ws://localhost:8080/sub
To subscribe to a channel, send channel name: mychannel
To unsubscribe from a channel, send 'unsub ' + channel name: unsub mychannel
Publish
Connect to ws://localhost:8080/pub
To publish message, send channel name and message: mychannel anything follows will be the message.