#pragma once #include using namespace drogon; class Scratchpad : public drogon::HttpController { public: METHOD_LIST_BEGIN // POST /scratchpad/run -> Protected (API Key required) METHOD_ADD(Scratchpad::runCode, "/run", Post); // GET /scratchpad/status -> Public METHOD_ADD(Scratchpad::status, "/status", Get); METHOD_LIST_END void runCode(const HttpRequestPtr& req, std::function &&callback); void status(const HttpRequestPtr& req, std::function &&callback); private: // Helper to compile and execute C++ code std::string compileAndRun(const std::string& code); const std::string API_KEY = "SixBabiesShittingPoutine!!"; // Protected access };