diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/emu/emuopts.h | 2 | ||||
-rw-r--r-- | src/emu/machine.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h index 2046661146b..99b5463f540 100644 --- a/src/emu/emuopts.h +++ b/src/emu/emuopts.h @@ -386,7 +386,7 @@ public: const char *language() const { return value(OPTION_LANGUAGE); } // Web server specific optopns - bool http() const { return value(OPTION_HTTP); } + bool http() const { return bool_value(OPTION_HTTP); } short http_port() const { return int_value(OPTION_HTTP_PORT); } const char *http_root() const { return value(OPTION_HTTP_ROOT); } diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp index ebeca3fe3c1..d528d9afd40 100644 --- a/src/emu/machine.cpp +++ b/src/emu/machine.cpp @@ -1183,6 +1183,8 @@ running_machine::logerror_callback_item::logerror_callback_item(logerror_callbac void running_machine::export_http_api() { + if (!options().http()) return; + m_manager.http_server()->on_get("/api/machine", [this](auto response, auto request) { rapidjson::StringBuffer s; |