This repository has been archived on 2021-03-22. You can view files and clone it, but cannot push or open issues or pull requests.
backend/src/main.cpp
2020-06-29 06:10:15 +02:00

60 lines
1.5 KiB
C++

/* This file is part of FediBlock-backend.
* Copyright © 2020 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cgi.hpp"
#include "json.hpp"
#include <iostream>
using std::cout;
using namespace FediBlock;
void print_debug()
{
cout << "\r\n\r\nDEBUG:\r\n";
const entry_type entry{parse_formdata()};
cout << " Instance: " << entry.instance << "\r\n";
cout << " Tags:";
for (const auto &tag : entry.tags)
{
cout << " " << tag;
}
cout << "\r\n";
cout << " Receipts:";
for (const auto &receipt : entry.receipts)
{
cout << " " << receipt;
}
cout << "\r\n";
cout << " Description: " << entry.description << "\r\n";
cout << "\r\n\r\nJSON:\r\n";
cout << to_json(entry) << "\r\n";
}
int main()
{
cout << "Content-Type: text/plain; charset=utf-8\r\n\r\n";
cout << "Received and filed to /dev/null. 😝\r\n";
print_debug();
return 0;
}