|
|
|
@ -29,7 +29,6 @@ Application::Application(const nlohmann::json &cfg) { |
|
|
|
int Application::run() { |
|
|
|
int Application::run() { |
|
|
|
std::vector<std::thread> servers; |
|
|
|
std::vector<std::thread> servers; |
|
|
|
orders orders(data_directory); |
|
|
|
orders orders(data_directory); |
|
|
|
orders.load(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const auto &m : {"GET", "POST", "PUT", "PATCH", "OPTIONS", "HEAD"}) { |
|
|
|
for (const auto &m : {"GET", "POST", "PUT", "PATCH", "OPTIONS", "HEAD"}) { |
|
|
|
if (https_server) { |
|
|
|
if (https_server) { |
|
|
|
@ -87,7 +86,8 @@ int Application::run() { |
|
|
|
return response::bad_request(response, v.errors()); |
|
|
|
return response::bad_request(response, v.errors()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// const auto json_response = dat.process(data);
|
|
|
|
orders.push_back(data); |
|
|
|
|
|
|
|
orders.write(); |
|
|
|
|
|
|
|
|
|
|
|
response->write(Status::success_created, data.dump(), |
|
|
|
response->write(Status::success_created, data.dump(), |
|
|
|
{header_access_control, header_application_data}); |
|
|
|
{header_access_control, header_application_data}); |
|
|
|
|