diff --git a/source/app.d b/source/app.d index 4cfb854..31959d8 100644 --- a/source/app.d +++ b/source/app.d @@ -49,6 +49,15 @@ void onAPIRequest(HTTPServerRequest request, HTTPServerResponse response) import std.stdio : writeln; writeln(apiEndpoint); + + import std.file : append; + struct LogEntry + { + string endpoint; + Json request; + Json response; + } + append("api.log", LogEntry(apiEndpoint, requestJson, finalResponseJson).serializeToJson.toPrettyString ~ "\n\n"); } Json getRequestJson(ubyte[] input, string endpoint, string nonce)