-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should summarize the changes within commit messages.
Refine boost library with served as http server handler. Following API requests with GET are also implemented: * GET /tag * GET /tips (fetch all tips) * GET /address
return EXIT_SUCCESS; | ||
#include <served/plugins.hpp> | ||
#include <served/served.hpp> | ||
#include "./apis.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix ./
looks redundant. Can you eliminate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required for cpplint:
Include the directory when naming .h files [build/include] [4]
config.h
Outdated
// Address binding and port for tangle-accelerator | ||
#define TA_HOST "localhost" | ||
#define TA_PORT "8000" | ||
#define TA_THREAD 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be explicit if changed to TA_THREAD_COUNT
.
server.cc
Outdated
cJSON_AddStringToObject(json_obj, "message", "Invalid path"); | ||
const char* json = cJSON_PrintUnformatted(json_obj); | ||
|
||
res.set_status(400); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you enumerate the possible error codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Tangle-Accelerator Core API. We have 400
for client bad request and 404
for request not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's introduce macro(s) to map these error codes.
Refine boost library with served as http server handler. Following API requests with GET are also implemented: