From 764a5e030fdb112736a29e6e2979dd83974ba2d1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 3 May 2025 16:56:10 +1200 Subject: [PATCH] . --- README.md | 2 ++ src/server.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 6d20572..3c0c70a 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ Public read actions: - get all metadata for a tag: - `curl http://localhost:8123/meta/squashkiwi:latest` +- quick status check: + - `curl http://localhost:8123/status` Write actions: diff --git a/src/server.cpp b/src/server.cpp index 1c76ff8..62c4f27 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -184,6 +184,10 @@ void Server::setup_routes() { server_.Get("/appendtag", [this](const httplib::Request& req, httplib::Response& res) { handle_append_tag(req, res); }); + + server_.Get("/status", [this](const httplib::Request& req, httplib::Response& res) { + res.set_content(nlohmann::json({{"result", "success"}, {"status", "ok"}}).dump(), "application/json"); + }); } void Server::handle_get_object(const httplib::Request& req, httplib::Response& res) {