aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-12-14 16:22:54 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-12-14 16:22:54 +0100
commit0afb137ec194066d7676424b641bc29bf73e0912 (patch)
treee78b9f326b0e051a8fad4b1f03a35ce863be0dd0
parent3066dda4e4e4be70335ca2dfbc74a20f4ff0dede (diff)
main: Removes setting roothttp to . by default
When option --roothttp is not set, the server will not serve HTTP files. Change-Id: I16e09f7ad6f735967cde27d5c51758499110fb54 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 58c0d8ec..8de402eb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -226,9 +226,6 @@ static void config_set_default (struct afb_config * config)
}
// if no Angular/HTML5 rootbase let's try '/' as default
- if (config->roothttp == NULL)
- config->roothttp = ".";
-
if (config->rootbase == NULL)
config->rootbase = "/opa";
@@ -538,8 +535,10 @@ static int init_http_server(struct afb_hsrv *hsrv, struct afb_config * config)
if (!afb_hsrv_add_alias (hsrv, config->aliasdir[idx].url, dfd, config->aliasdir[idx].path, 0, 0))
return 0;
- if (!afb_hsrv_add_alias(hsrv, "", dfd, config->roothttp, -10, 1))
- return 0;
+ if (config->roothttp != NULL) {
+ if (!afb_hsrv_add_alias(hsrv, "", dfd, config->roothttp, -10, 1))
+ return 0;
+ }
if (!afb_hsrv_add_handler(hsrv, config->rootbase, afb_hswitch_one_page_api_redirect, NULL, -20))
return 0;