cleanup
This commit is contained in:
@@ -5,15 +5,6 @@
|
|||||||
|
|
||||||
#include "book_client.h"
|
#include "book_client.h"
|
||||||
|
|
||||||
// Memory leak detection with VLD.
|
|
||||||
#if (defined(_WIN32) || defined(_WIN64))
|
|
||||||
#if defined(_DEBUG) && defined(WEBCC_ENABLE_VLD)
|
|
||||||
#pragma message ("< include vld.h >")
|
|
||||||
#include "vld/vld.h"
|
|
||||||
#pragma comment(lib, "vld")
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
void PrintSeparator() {
|
void PrintSeparator() {
|
||||||
@@ -56,7 +47,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE_FILE_OVERWRITE);
|
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE_FILE_OVERWRITE);
|
||||||
|
|
||||||
BookClient client(url);
|
BookClient client{ url };
|
||||||
|
|
||||||
PrintSeparator();
|
PrintSeparator();
|
||||||
|
|
||||||
|
|||||||
@@ -6,15 +6,6 @@
|
|||||||
|
|
||||||
#include "views.h"
|
#include "views.h"
|
||||||
|
|
||||||
// Memory leak detection with VLD.
|
|
||||||
#if (defined(_WIN32) || defined(_WIN64))
|
|
||||||
#if defined(_DEBUG) && defined(WEBCC_ENABLE_VLD)
|
|
||||||
#pragma message ("< include vld.h >")
|
|
||||||
#include "vld/vld.h"
|
|
||||||
#pragma comment(lib, "vld")
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
std::cout << "usage: book_server <port> <upload_dir>" << std::endl;
|
std::cout << "usage: book_server <port> <upload_dir>" << std::endl;
|
||||||
@@ -43,7 +34,7 @@ int main(int argc, char* argv[]) {
|
|||||||
std::cout << "Book photos will be saved to: " << photo_dir << std::endl;
|
std::cout << "Book photos will be saved to: " << photo_dir << std::endl;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webcc::Server server(port); // No doc root
|
webcc::Server server{ port }; // No doc root
|
||||||
|
|
||||||
server.Route("/books",
|
server.Route("/books",
|
||||||
std::make_shared<BookListView>(),
|
std::make_shared<BookListView>(),
|
||||||
|
|||||||
@@ -40,9 +40,11 @@ int main(int argc, const char* argv[]) {
|
|||||||
LOG_USER("Sleep seconds: %d", sleep_seconds);
|
LOG_USER("Sleep seconds: %d", sleep_seconds);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webcc::Server server(8080);
|
webcc::Server server{ 8080 };
|
||||||
|
|
||||||
server.Route("/", std::make_shared<HelloView>(sleep_seconds));
|
auto view = std::make_shared<HelloView>(sleep_seconds);
|
||||||
|
server.Route("/", view);
|
||||||
|
server.Route("/hello", view);
|
||||||
|
|
||||||
server.Run(workers);
|
server.Run(workers);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ int main() {
|
|||||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webcc::Server server(8080);
|
webcc::Server server{ 8080 };
|
||||||
|
|
||||||
server.Route("/", std::make_shared<HelloView>());
|
server.Route("/", std::make_shared<HelloView>());
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ int main(int argc, char* argv[]) {
|
|||||||
std::string doc_root = argv[2];
|
std::string doc_root = argv[2];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
webcc::Server server(port, doc_root);
|
webcc::Server server{ port, doc_root };
|
||||||
|
|
||||||
if (argc == 4) {
|
if (argc == 4) {
|
||||||
server.set_file_chunk_size(std::atoi(argv[3]));
|
server.set_file_chunk_size(std::atoi(argv[3]));
|
||||||
|
|||||||
Reference in New Issue
Block a user