Adds 2017 to copyrights
[src/app-framework-binder.git] / src / main.c
index 58c0d8e..4a074ee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015, 2016 "IoT.bzh"
+ * Copyright (C) 2015, 2016, 2017 "IoT.bzh"
  * Author "Fulup Ar Foll"
  * Author José Bollo <jose.bollo@iot.bzh>
  *
@@ -156,7 +156,7 @@ static void printVersion (FILE *file)
    fprintf(file, "\n----------------------------------------- \n");
    fprintf(file, "  AFB [Application Framework Binder] version=%s |\n", AFB_VERSION);
    fprintf(file, " \n");
-   fprintf(file, "  Copyright (C) 2015, 2016 \"IoT.bzh\" [fulup -at- iot.bzh]\n");
+   fprintf(file, "  Copyright (C) 2015, 2016, 2017 \"IoT.bzh\" [fulup -at- iot.bzh]\n");
    fprintf(file, "  AFB comes with ABSOLUTELY NO WARRANTY.\n");
    fprintf(file, "  Licence Apache 2\n\n");
    exit (0);
@@ -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;