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) {