diff --git a/CONFIG.h b/CONFIG.h new file mode 100644 index 0000000..6d2ab8d --- /dev/null +++ b/CONFIG.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_H_ +#define CONFIG_H_ + +#define CONFIG_LISTEN_URL "http://0.0.0.0:8080" + +#endif // CONFIG_H_ diff --git a/build.c b/build.c index e6a5d3a..a7e95d6 100644 --- a/build.c +++ b/build.c @@ -23,6 +23,7 @@ int main(int argc, char ** argv) "./commit.h", "./timer.c", "./timer.h", + "./CONFIG.h", "./mongoose.o", "./gpp1", diff --git a/main.c b/main.c index 8cedc23..f09fb17 100644 --- a/main.c +++ b/main.c @@ -10,6 +10,7 @@ #include "routes.h" #include "baked.h" #include "timer.h" +#include "CONFIG.h" Route *route_hashtable = NULL; @@ -132,7 +133,7 @@ int main(int argc, char ** argv) defer { free_route_hashtable(); } mg_wakeup_init(&mgr); - mg_http_listen(&mgr, "http://localhost:8080", &event_handler, NULL); + mg_http_listen(&mgr, CONFIG_LISTEN_URL, &event_handler, NULL); for (;;) { mg_mgr_poll(&mgr, 1000);