Skip to main content
added 484 characters in body
Source Link
Radagast
  • 295
  • 2
  • 8

Compile


#!/bin/bash

sudo g++ \
    main.cpp \
    -I lib \
        ./lib/json.hpp \
    -I src \
        ./src/Server/Server.h ./src/Server/Server.cpp \
        ./src/Server/Request.h ./src/Server/Request.cpp \
        ./src/Server/Response.h ./src/Server/Response.cpp \
        ./src/Server/Routes.h ./src/Server/Routes.cpp \
        ./src/Server/Struct.h \
        ./src/Server/StatusCode.h \
        ./src/Tools/Logger.h \
    -pthread \
-o main.exe

sudo chmod +x main.exe
sudo ./main.exe

Compile


#!/bin/bash

sudo g++ \
    main.cpp \
    -I lib \
        ./lib/json.hpp \
    -I src \
        ./src/Server/Server.h ./src/Server/Server.cpp \
        ./src/Server/Request.h ./src/Server/Request.cpp \
        ./src/Server/Response.h ./src/Server/Response.cpp \
        ./src/Server/Routes.h ./src/Server/Routes.cpp \
        ./src/Server/Struct.h \
        ./src/Server/StatusCode.h \
        ./src/Tools/Logger.h \
    -pthread \
-o main.exe

sudo chmod +x main.exe
sudo ./main.exe
deleted 8 characters in body; edited title
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

Simple HttpHTTP Server

Basically I'm creating a Http Serveran HTTP server (simple, but not too simple) in C++ using sockets and multi-threading.

There are two topics that I'm concerned about: the design pattern of my code structure and the efficiency of my thread implementation. Obs: I'm a little worried about C++ best practices, since I'm diving too fast into C++ (Amam I abusing of std items?, since this requirerequires a low-level implementation).

IMPORTANT: I'm using nlohmann/json (https://github.com/nlohmann/json) and j-ulrich status-codes (https://github.com/j-ulrich/http-status status-codes-cpp).


 

 

 

 

https://github.com/j-ulrich/http-status-codes-cpp

http-status-codes-cpp


 

Basically I'm mirroring NodeJS express API Usage: server.setRoute(path, route, callback);

Basically I'm mirroring NodeJS express API Usage: server.setRoute(path, route, callback);

Thanks in advance.

Simple Http Server

Basically I'm creating a Http Server (simple, but not too simple) in C++ using sockets and multi-threading.

There are two topics that I'm concerned about: the design pattern of my code structure and the efficiency of my thread implementation. Obs: a little worried about C++ best practices, since I'm diving too fast into C++ (Am I abusing of std items?, since this require a low-level implementation).

IMPORTANT: I'm using nlohmann/json (https://github.com/nlohmann/json) and j-ulrich status-codes (https://github.com/j-ulrich/http-status-codes-cpp).


 

 

 

 

https://github.com/j-ulrich/http-status-codes-cpp


 

Basically I'm mirroring NodeJS express API Usage: server.setRoute(path, route, callback);

Thanks in advance.

Simple HTTP Server

Basically I'm creating an HTTP server (simple, but not too simple) in C++ using sockets and multi-threading.

There are two topics that I'm concerned about: the design pattern of my code structure and the efficiency of my thread implementation. Obs: I'm a little worried about C++ best practices, since I'm diving too fast into C++ (am I abusing of std items, since this requires a low-level implementation).

IMPORTANT: I'm using nlohmann/json and j-ulrich status-codes.

http-status-codes-cpp

Basically I'm mirroring NodeJS express API Usage: server.setRoute(path, route, callback);

Tweeted twitter.com/StackCodeReview/status/1119798218806763524
Became Hot Network Question
added 158 characters in body
Source Link
Radagast
  • 295
  • 2
  • 8

There are two topics that I'm concerned about: the design pattern of my code structure and the efficiency of my thread implementation. Obs: a little worried about C++ best practices, since I'm diving too fast into C++ (Am I abusing of std items?, since this require a low-level implementation).

IMPORTANT: I'm using nlohmann/json (https://github.com/nlohmann/json) and j-ulrich status-codes (https://github.com/j-ulrich/http-status-codes-cpp).

There are two topics that I'm concerned about: the design pattern of my code structure and the efficiency of my thread implementation. Obs: a little worried about C++ best practices, since I'm diving too fast into C++.

There are two topics that I'm concerned about: the design pattern of my code structure and the efficiency of my thread implementation. Obs: a little worried about C++ best practices, since I'm diving too fast into C++ (Am I abusing of std items?, since this require a low-level implementation).

IMPORTANT: I'm using nlohmann/json (https://github.com/nlohmann/json) and j-ulrich status-codes (https://github.com/j-ulrich/http-status-codes-cpp).

added whole src
Source Link
Radagast
  • 295
  • 2
  • 8
Loading
Source Link
Radagast
  • 295
  • 2
  • 8
Loading