diff --git a/CMakeLists.txt b/CMakeLists.txt index 07b859b0..d62f7744 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/neuron.yaml b/neuron.yaml index a4af34ff..e69de29b 100644 --- a/neuron.yaml +++ b/neuron.yaml @@ -1,6 +0,0 @@ -web: - host: 0.0.0.0 - port: 7000 -api: - host: 0.0.0.0 - port: 7001 diff --git a/plugins/restful/rest.c b/plugins/restful/rest.c index 4d806f2f..8c652840 100644 --- a/plugins/restful/rest.c +++ b/plugins/restful/rest.c @@ -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); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4955513c..ae0b3d65 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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)