mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
test content type html response
https://github.com/moneroexamples/onion-monero-blockchain-explorer/issues/160#issuecomment-472205835
This commit is contained in:
parent
40c08b86f2
commit
d45b6b9c46
1 changed files with 11 additions and 1 deletions
12
main.cpp
12
main.cpp
|
@ -17,6 +17,15 @@ using namespace std;
|
|||
|
||||
namespace myxmr
|
||||
{
|
||||
struct htmlresponse: crow::response
|
||||
{
|
||||
htmlresponse(string&& _body)
|
||||
: crow::response {std::move(_body)}
|
||||
{
|
||||
add_header("Content-Type", "text/html; charset=utf-8");
|
||||
}
|
||||
};
|
||||
|
||||
struct jsonresponse: crow::response
|
||||
{
|
||||
jsonresponse(const nlohmann::json& _body)
|
||||
|
@ -291,7 +300,8 @@ main(int ac, const char* av[])
|
|||
|
||||
CROW_ROUTE(app, "/")
|
||||
([&]() {
|
||||
return crow::response(xmrblocks.index2());
|
||||
//return crow::response(xmrblocks.index2());
|
||||
return myxmr::htmlresponse(xmrblocks.index2());
|
||||
});
|
||||
|
||||
CROW_ROUTE(app, "/page/<uint>")
|
||||
|
|
Loading…
Reference in a new issue