log: Show the version number in the welcome banner.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 15m53s

This commit is contained in:
Cory McWilliams 2024-11-02 08:42:15 -04:00
parent 5839380437
commit 4482049b94

View File

@ -10,6 +10,7 @@
#include "tlscontext.js.h" #include "tlscontext.js.h"
#include "trace.h" #include "trace.h"
#include "util.js.h" #include "util.js.h"
#include "version.h"
#include "ow-crypt.h" #include "ow-crypt.h"
@ -33,6 +34,7 @@
#define CYAN "\e[1;36m" #define CYAN "\e[1;36m"
#define MAGENTA "\e[1;35m" #define MAGENTA "\e[1;35m"
#define YELLOW "\e[1;33m"
#define RESET "\e[0m" #define RESET "\e[0m"
const int64_t k_refresh_interval = 1ULL * 7 * 24 * 60 * 60 * 1000; const int64_t k_refresh_interval = 1ULL * 7 * 24 * 60 * 60 * 1000;
@ -423,7 +425,7 @@ static JSValue _httpd_endpoint_start(JSContext* context, JSValueConst this_val,
*listener = (httpd_listener_t) { .context = context, .tls = JS_DupValue(context, argv[1]) }; *listener = (httpd_listener_t) { .context = context, .tls = JS_DupValue(context, argv[1]) };
tf_tls_context_t* tls = tf_tls_context_get(listener->tls); tf_tls_context_t* tls = tf_tls_context_get(listener->tls);
int assigned_port = tf_http_listen(http, port, tls, _httpd_listener_cleanup, listener); int assigned_port = tf_http_listen(http, port, tls, _httpd_listener_cleanup, listener);
tf_printf(CYAN "~😎 Tilde Friends" RESET " is now up at " MAGENTA "http%s://127.0.0.1:%d/" RESET ".\n", tls ? "s" : "", assigned_port); tf_printf(CYAN "~😎 Tilde Friends" RESET " " YELLOW VERSION_NUMBER RESET " is now up at " MAGENTA "http%s://127.0.0.1:%d/" RESET ".\n", tls ? "s" : "", assigned_port);
return JS_NewInt32(context, assigned_port); return JS_NewInt32(context, assigned_port);
} }