mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
add get version restful api
This commit is contained in:
@@ -48,6 +48,10 @@
|
||||
#include <tchar.h>
|
||||
#endif // _WIN32
|
||||
|
||||
#if defined(ENABLE_VERSION)
|
||||
#include "version.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace Json;
|
||||
using namespace toolkit;
|
||||
@@ -1542,6 +1546,18 @@ void installWebApi() {
|
||||
});
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_VERSION)
|
||||
api_regist("/index/api/version",[](API_ARGS_MAP_ASYNC){
|
||||
CHECK_SECRET();
|
||||
Value ver;
|
||||
ver["buildTime"] = BUILD_TIME;
|
||||
ver["branchName"] = BRANCH_NAME;
|
||||
ver["commitHash"] = COMMIT_HASH;
|
||||
val["data"] = ver;
|
||||
invoker(200, headerOut, val.toStyledString());
|
||||
});
|
||||
#endif
|
||||
|
||||
////////////以下是注册的Hook API////////////
|
||||
api_regist("/index/hook/on_publish",[](API_ARGS_JSON){
|
||||
//开始推流事件
|
||||
|
||||
Reference in New Issue
Block a user