temp change of tx route

This commit is contained in:
moneroexamples 2016-08-20 17:16:18 +08:00
parent 8506b0853c
commit b3cecb8d2a
1 changed files with 16 additions and 3 deletions

View File

@ -101,7 +101,11 @@ int main(int ac, const char* av[]) {
crow::SimpleApp app; crow::SimpleApp app;
CROW_ROUTE(app, "/") CROW_ROUTE(app, "/")
([&]() { ([&](const crow::request& req) {
for (const auto& m : req.headers)
cout << m.first << ": " << m.second << endl;
return xmrblocks.index2(); return xmrblocks.index2();
}); });
@ -120,9 +124,18 @@ int main(int ac, const char* av[]) {
return xmrblocks.show_block(block_hash); return xmrblocks.show_block(block_hash);
}); });
// CROW_ROUTE(app, "/tx/<string>")
// ([&](string tx_hash) {
// return xmrblocks.show_tx(tx_hash);
// });
CROW_ROUTE(app, "/tx/<string>") CROW_ROUTE(app, "/tx/<string>")
([&](string tx_hash) { ([&](const crow::request& req) {
return xmrblocks.show_tx(tx_hash);
for (const auto& m : req.headers)
cout << m.first << ": " << m.second << endl;
return "";
}); });
CROW_ROUTE(app, "/tx/<string>/<uint>") CROW_ROUTE(app, "/tx/<string>/<uint>")