Merge pull request #341 from fengzeroz/main

remove options in neuron.yaml that do not require user configuration
This commit is contained in:
fengzeroz
2022-03-18 11:30:32 +08:00
committed by GitHub
4 changed files with 7 additions and 21 deletions
+1 -5
View File
@@ -212,12 +212,8 @@ install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/"
DESTINATION include/neuron
FILES_MATCHING
PATTERN "*.h")
install(FILES "${CMAKE_SOURCE_DIR}/neuron.yaml"
"${CMAKE_SOURCE_DIR}/private_test.key"
"${CMAKE_SOURCE_DIR}/public_test.pem"
DESTINATION etc/neuron)
install(FILES "${CMAKE_SOURCE_DIR}/cmake/neuron-config.cmake"
DESTINATION lib/cmake/neuron)
install(TARGETS neuron-base neuron
install(TARGETS neuron-base
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
-6
View File
@@ -1,6 +0,0 @@
web:
host: 0.0.0.0
port: 7000
api:
host: 0.0.0.0
port: 7001
+5 -9
View File
@@ -100,20 +100,16 @@ static int rest_add_handler(nng_http_server * server,
static nng_http_server *server_init(char *type)
{
nng_url * url;
char * host = NULL;
char * port = NULL;
char host_port[128] = { 0 };
nng_http_server *server;
host = neu_config_get_value(2, type, "host");
port = neu_config_get_value(2, type, "port");
snprintf(host_port, sizeof(host_port), "http://%s:%s", host, port);
if (strncmp(type, "api", strlen("api")) == 0) {
snprintf(host_port, sizeof(host_port), "http://0.0.0.0:7001");
} else {
snprintf(host_port, sizeof(host_port), "http://0.0.0.0:7000");
}
log_info("%s bind url: %s", type, host_port);
free(host);
free(port);
int ret = nng_url_parse(&url, host_port);
if (ret != 0) {
nng_url_free(url);
+1 -1
View File
@@ -166,7 +166,7 @@ target_link_libraries(base64_test neuron-base gtest_main gtest crypto)
include(GoogleTest)
gtest_discover_tests(data_val_test)
gtest_discover_tests(modbus_point_test)
gtest_discover_tests(config_test)
#gtest_discover_tests(config_test)
gtest_discover_tests(plugin_manager_test)
gtest_discover_tests(datatag_table_test)
gtest_discover_tests(json_test)