'Generic Commit'
Some checks failed
dropshell-build / build (push) Has been cancelled

This commit is contained in:
Your Name
2025-06-02 08:03:02 +12:00
parent 2d62d7af7f
commit 16b2ce5b52
50 changed files with 50 additions and 60 deletions

26
ipdemo/src/main.cpp Normal file
View File

@ -0,0 +1,26 @@
#include <iostream>
#include <nlohmann/json.hpp>
#include <libassert/assert.hpp>
#include "httplib.hpp"
#include "version.hpp"
int main() {
std::cout << "Retrieving IP address..." << std::endl;
httplib::Client cli("http://ipinfo.io");
auto res = cli.Get("/ip");
ASSERT(res->status == 200, "Failed to get IP");
nlohmann::json j;
j["ip"] = res->body;
j["status"] = res->status;
std::cout << j.dump(4) << std::endl;
std::cout << "Done" << std::endl;
return 0;
}