Update README.md & Rename web_server to neu_webserver

This commit is contained in:
alvin1221
2021-08-06 15:58:42 +08:00
parent 01f98406cc
commit 1b60a11e21
5 changed files with 21 additions and 7 deletions
+1 -2
View File
@@ -40,8 +40,7 @@ set(NEURON_SOURCES
src/core/plugin_manager.c
src/core/datatag_table.c
src/adapter/adapter.c
src/adapter/web_server.c
)
src/adapter/neu_webserver.c)
set(NEURON_INCLUDE_DIRECTORIES include src)
add_executable(neuron)
+7
View File
@@ -82,3 +82,10 @@ NEURON IIoT System for Industry 4.0
$ brew install ossp-uuid
```
- [neuron-dashboard](https://github.com/neugates/neuron-dashboard-src/releases)
```shell
# Download lastest neuron-dashboard release from https://github.com/neugates/neuron-dashboard-src/releases
# Unzip and move to "build"
$ unzip neuron-dashboard.zip -d build
```
@@ -37,7 +37,7 @@
#include "neu_log.h"
#include "neu_panic.h"
#include "neu_plugin.h"
#include "web_server.h"
#include "neu_webserver.h"
// utility function
@@ -263,6 +263,14 @@ void rest_start(uint16_t port)
nng_url * url;
int rv;
char source[256] = {0};
getcwd(source, 256);
strcat(source, "/dist");
log_debug("source dir: %s", source);
if ((rv = nng_mtx_alloc(&job_lock)) != 0) {
fatal("nng_mtx_alloc", rv);
}
@@ -311,7 +319,7 @@ void rest_start(uint16_t port)
}
// Specify local directory for root url "/"
rv = nng_http_handler_alloc_directory(&handler_file, "", "./dist");
rv = nng_http_handler_alloc_directory(&handler_file, "", source);
if (rv != 0) {
fatal("nng_http_handler_alloc_file", rv);
}
@@ -17,8 +17,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
#ifndef __WEB_SERVER_H__
#define __WEB_SERVER_H__
#ifndef __NEU_WEB_SERVER_H__
#define __NEU_WEB_SERVER_H__
#define REST_URL "http://0.0.0.0:%u/api/v2"
#define DEFAULT_PORT 7000
+1 -1
View File
@@ -27,11 +27,11 @@
#include <nng/protocol/bus0/bus.h>
#include <nng/supplemental/util/platform.h>
#include "adapter/web_server.h"
#include "core/neu_manager.h"
#include "neu_log.h"
#include "neu_panic.h"
#include "utils/idhash.h"
#include "adapter/neu_webserver.h"
static nng_thread *web_thread;
static nng_mtx * log_mtx;