{"id":5582,"date":"2026-05-05T15:58:21","date_gmt":"2026-05-05T06:58:21","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=5582"},"modified":"2026-05-05T15:58:34","modified_gmt":"2026-05-05T06:58:34","slug":"webserver-miniwebserver-5","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2026\/05\/05\/webserver-miniwebserver-5\/","title":{"rendered":"[Webserver]miniWebserver (5)"},"content":{"rendered":"\n<p>\ud83d\udc49\ud83c\udffb \uc8fc\uc694 \ubcc0\uacbd\uc0ac\ud56d\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<br>The major changes are as follows.<\/p>\n\n\n\n<p>\u2714\ufe0f \uae30\uc874\uc758 \ucee4\ub9e8\ub4dc \uc885\ub8cc \ubd80\ubd84\uc744 \ud568\uc218\ub85c \ubcc0\uacbd\ud588\uc2b5\ub2c8\ub2e4.(main.cpp)<br>I changed the existing command termination part to a function. (main.cpp)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> my_server.run_cmd();<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f \ub77c\uc6b0\ud130 \uc124\uc815 \ud30c\uc77c\uc744 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.<br>I added the router configuration file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Router.h Router.cpp<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f \ub77c\uc6b0\ud130\uc5d0 \ub9c8\uc784\ud0c0\uc785\uc744 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.(\uc544\uc9c1\uc740 body\ub9cc \ub9ac\ud134)<br>Added MIME types to the router. (Currently only returns body)<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \uae30\uc874 \ucf54\ub4dc\uc5d0\uc11c \ucd94\uac00\ud558\uac70\ub098 \ubcc0\uacbd\ub41c \ubd80\ubd84\uc740 \u2757\ufe0f\ub85c \ud45c\uc2dc\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4.<br>Parts added or changed from the existing code are marked with \u2757\ufe0f.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \ub098\uba38\uc9c0 \uc124\uba85\uc740 \ucf54\ub4dc \uc8fc\uc11d\uc744 \ucc38\uace0\ud558\uc138\uc694<br>Please refer to the code comments for the rest of the explanation.<\/p>\n\n\n\n<p>\ud83d\udc49\ud83c\udffb \ucf54\ub4dc \/ Code<\/p>\n\n\n\n<p>\u2714\ufe0f Main.cpp<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include \"Server.h\" \/\/ \uc18c\ucf13\uc11c\ubc84\/Scoket Server\n#include \"Router.h\" \/\/ \ub77c\uc6b0\ud130\/router\u2757\ufe0f\n#include &lt;iostream&gt;\n#include &lt;thread&gt;\n#include &lt;chrono&gt;\n#include &lt;atomic&gt;\n#include &lt;string&gt;\n#include &lt;map&gt;\n#include &lt;utility&gt; \/\/ std::pair \uc0ac\uc6a9\uc744 \uc704\ud574 \ucd94\uac00 \/ Added for using std::pair \u2757\ufe0f\n\n\nint main() {\n    Server my_server(\"127.0.0.1\", 5080);\n    Router my_router; \/\/ \ub77c\uc6b0\ud130 \uc778\uc2a4\ud134\uc2a4 \/ router instance \u2757\ufe0f\n\n    \/\/ \ud578\ub4e4\ub7ec \uc124\uc815 - \ub9c8\uc784\ud0c0\uc785\uc801\uc6a9 \u2757\ufe0f\n    \/\/ Handler Settings - Apply Mime Type\n    my_server.set_handler(&#91;&amp;](const std::string&amp; req) {\n        auto &#91;mime, body] = my_router.router(req);\n        \/\/ \uc5ec\uae30\uc11c mime\ub3c4 \uac19\uc774 \ub118\uaca8\uc918\uc57c \ud558\uc9c0\ub9cc, \ud604\uc7ac\ub294 body\ub9cc \ub9ac\ud134\ud558\ub294 \uad6c\uc870\uc785\ub2c8\ub2e4.\n        \/\/ Although the mime should also be passed here, the current structure only returns the body.\n        return body;\n    });\n\n    \/\/ 3. \uc11c\ubc84 \uc5d4\uc9c4 \uc2dc\uc791 (\uc2a4\ub808\ub4dc) \/ Start server engine (thread)\n    std::thread server_thread(&amp;Server::start, &amp;my_server);\n    std::cout &lt;&lt; \"--- Starting Server Application ---\" &lt;&lt; std::endl;\n\n    \/\/ 4. \ucee4\ub9e8\ub4dc \uc785\ub825 \ub8e8\ud504 (\uc2a4\ub808\ub4dc\ub85c \ub3cc\ub9ac\uc9c0 \ub9d0\uace0 \uba54\uc778\uc5d0\uc11c \uc9c1\uc811 \uc2e4\ud589) \u2757\ufe0f\n    \/\/ \uba54\uc778 \uc2a4\ub808\ub4dc\uac00 \uc5ec\uae30\uc11c \uc785\ub825\uc744 \ub300\uae30\ud558\ubbc0\ub85c \ud504\ub85c\uadf8\ub7a8\uc774 \ubc14\ub85c \uc885\ub8cc\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.\n\n    \/\/ 4. Command Input Loop (Do not run as a thread, execute directly in Main)\n    \/\/ The main thread waits for input here, so the program does not terminate immediately.\n    my_server.run_cmd();\n\n    \/\/ 5. run_cmd()\ub97c \ube60\uc838\ub098\uc654\ub2e4\ub294 \uac83\uc740 \uc0ac\uc6a9\uc790\uac00 exit\ub97c \ucce4\ub2e4\ub294 \ub73b\uc774\ubbc0\ub85c \uc815\ub9ac \uc2dc\uc791\n    \/\/ 5. Exiting run_cmd() means the user typed exit, so start cleaning up.\n    my_server.stop();\n\n    if (server_thread.joinable()) {\n        server_thread.join();\n    }\n\n    std::cout &lt;&lt; \"&#91;MAIN] Server Application Finished.\" &lt;&lt; std::endl;\n    return 0;\n}\n<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f Server.h<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;string&gt;\n#include &lt;atomic&gt;\n#include &lt;functional&gt;\n\nclass Server {\npublic:\n    \/\/ \uc0dd\uc131\uc790: \uc11c\ubc84 \ucd08\uae30\ud654 (IP, Port)\n    \/\/ Constructor: Initialize server (IP, Port)\n    Server(const std::string&amp; ip, int port);\n\n    \/\/ \uc18c\uba78\uc790 \/ Destructor\n    ~Server() {\n        stop();\n    }\n\n    \/\/ \uc11c\ubc84 \uc18c\ucf13 \ud30c\uc77c \ub514\uc2a4\ud06c\ub9bd\ud130\ub97c \uc800\uc7a5\ud560 \uba64\ubc84 \ubcc0\uc218\n    \/\/ Member variable to store server socket file descriptors\n    int server_fd = -1;\n\n    \/\/ \uc11c\ubc84 \uc2e4\ud589 \ud568\uc218: \ub9ac\uc2a4\ub2dd\uc744 \uc2dc\uc791\ud558\uace0 \uba54\uc778 \ub8e8\ud504\ub97c \ub3cc\ub9bc\n    \/\/ Server execution function: Starts listening and runs the main loop\n    bool start();\n\n    \/\/ \uc11c\ubc84 \uc885\ub8cc \/ Server close(\ud544\uc694\ud558\ub2e4\uba74 \/ if neccessary)\n    \/\/ Shut down the server (if necessary)\n    void stop();\n\n    \/\/ \ucee4\ub9e8\ub4dc \ub85c\uc9c1 \uad6c\ud604 \/ implement command login\u2757\ufe0f\n    void run_cmd();\n\n    \/\/ -- \ube0c\ub77c\uc6b0\uc800 \uba54\uc138\uc9c0 \ubc14\uafb8\uae30 \/ Change browser message --\n    \/\/ string(\uc694\uccad)\uc744 \ubc1b\uc544\uc11c string(\uc751\ub2f5\ub0b4\uc6a9)\uc744 \ubc49\ub294 \ud568\uc218\ub97c \ub2f4\ub294 \uadf8\ub987\n    \/\/ A container for a function that takes a string (request) and returns a string (response content)\n    std::function&lt;std::string(const std::string&amp;)&gt; logic_handler;\n\n    \/\/ main\uc5d0\uc11c \ub78c\ub2e4\ub97c \ub123\uc5b4\uc904 \ud568\uc218(Main.cpp\uc5d0\uc11c\uc0ac\uc6a9)\n    \/\/ Function to pass the lambda in main (used in Main.cpp)\n    void set_handler(std::function&lt;std::string(const std::string&amp;)&gt; handler) {\n        logic_handler = handler;\n    }\n\n    void handle_client_test(int client_socket);\n\n\nprivate:\n    std::string ip_address;\n    int port_number;\n\n    \/\/ \uc11c\ubc84\uac00 \uc2e4\ud589 \uc0c1\ud0dc\uc778\uc9c0 \ud655\uc778\ud558\ub294 \ud50c\ub798\uadf8\n    \/\/ Flag to check if the server is running\n    std::atomic&lt;bool&gt; running{false};\n\n    \/\/ \uc2e4\uc81c \ub9ac\uc2a4\ub2dd \ubc0f \uc5f0\uacb0 \uc218\uc2e0 \ub85c\uc9c1 (\ub0b4\ubd80 \uad6c\ud604)\n    \/\/ Actual listening and connection reception logic (internal implementation)\n    void run_listener();\n\n    \/\/ \uc5f0\uacb0 \ucc98\ub9ac \ub85c\uc9c1 (\uc2a4\ub808\ub4dc \ud480 \ub610\ub294 \ubcc4\ub3c4 \ud578\ub4e4\ub7ec\uc5d0\uac8c \uc704\uc784)\n    \/\/ Connection handling logic (delegated to thread pool or separate handler)\n    void handle_client(int client_socket);\n\n};\n<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0fServer.cpp<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include \"Server.h\"\n#include &lt;iostream&gt;\n#include &lt;cstring&gt;\n#include &lt;unistd.h&gt;\n#include &lt;sys\/socket.h&gt;\n#include &lt;netinet\/in.h&gt;\n#include &lt;thread&gt;\n#include &lt;vector&gt;\n#include &lt;functional&gt; \/\/ \ucd94\uac00 \/ add\n\n#define BACKLOG 10 \/\/ \ub300\uae30 \ud050 \ud06c\uae30 \/ wait queue size\n\nServer::Server(const std::string&amp; ip, int port)\n    : ip_address(ip), port_number(port) {}\n\nvoid Server::run_listener() {\n    \/\/std::cout &lt;&lt; \"&#91;INFO] Server listening on \" &lt;&lt; ip_address &lt;&lt; \":\" &lt;&lt; port_number &lt;&lt; std::endl;\n\n    \/\/ --- 1. \uc18c\ucf13 \uc0dd\uc131 \/ Socket Creation --- \/\/\n\n    server_fd = socket(AF_INET, SOCK_STREAM, 0);\n\n    if (server_fd == -1) {\n        perror(\"socket failed\");\n        exit(EXIT_FAILURE);\n    }\n\n    int opt = 1;\n    if (setsockopt(server_fd, SOL_SOCKET, SO_REUSEADDR, &amp;opt, sizeof(opt)) &lt; 0) {\n        perror(\"setsockopt\");\n        exit(EXIT_FAILURE);\n    }\n\n    \/\/ --- 2. \ubc14\uc778\ub529 \/ Binding --- \/\/\n    struct sockaddr_in address;\n    address.sin_family = AF_INET;           \/\/ IPv4\n    address.sin_addr.s_addr = INADDR_ANY;   \/\/ \ubaa8\ub4e0 \uc778\ud130\ud398\uc774\uc2a4 IP \uc0ac\uc6a9 \/ Use all interface IPs\n    address.sin_port = htons(port_number);  \/\/ \ud3ec\ud2b8\ub97c \ub124\ud2b8\uc6cc\ud06c \ubc14\uc774\ud2b8 \uc21c\uc11c\ub85c \ubcc0\ud658 \/ Convert ports to network byte order\n\n    if (bind(server_fd, (struct sockaddr *)&amp;address, sizeof(address)) &lt; 0) {\n        perror(\"bind failed\");\n        close(server_fd);\n        exit(EXIT_FAILURE);\n    }\n\n    \/\/ --- 3. \ub9ac\uc2a4\ub2dd \uc2dc\uc791 (setsockopt: listen_socket(socket)) --- \/\/\n    if (listen(server_fd, BACKLOG) &lt; 0) {\n        perror(\"listen failed\");\n        close(server_fd);\n        exit(EXIT_FAILURE);\n    }\n    std::cout &lt;&lt; \"Server listening on port \" &lt;&lt; port_number &lt;&lt; \"...\" &lt;&lt; std::endl;\n\n    \/\/ --- 4. \uba54\uc778 \ub8e8\ud504 \/ Accept loop: \ud074\ub77c\uc774\uc5b8\ud2b8 \uc5f0\uacb0\uc744 \ubb34\ud55c\ud788 \uae30\ub2e4\ub9bc \/ Infinitely waiting for client connections --- \/\/\n\n    \/\/ \ubb34\ud55c\ub8e8\ud504\uc5d0\uc11c \uc885\ub8cc\uc2e0\ud638\ub97c \ubc1b\uc73c\uba74 \ub8e8\ud504\ub97c \uc885\ub8cc \/ Exit the loop when the termination signal is received\n    while (running.load()) {\n\n        \/\/ \uc885\ub8cc\uc2e0\ud638 \uc5ec\ubd80\ub97c \ud655\uc778\ud558\uae30 \uc704\ud574 0.1\ucd08 \ub300\uae30 \/ Wait for 0.1 seconds to check the termination signal\n        std::this_thread::sleep_for(std::chrono::milliseconds(100)); \/\/ \ubd80\ud558 \ubc29\uc9c0\ub97c \uc704\ud574 \ub300\uae30\n\n        \/\/ IPv4\uad6c\uc870\uccb4 \/ Structure for IPv4 address\n        struct sockaddr_in client_address;\n        socklen_t addrlen = sizeof(client_address);\n\n        \/\/ accept() \ud568\uc218\uac00 \ube14\ub85c\ud0b9(Blocking) \uc0c1\ud0dc\uc5d0\uc11c \ud074\ub77c\uc774\uc5b8\ud2b8 \uc5f0\uacb0\uc744 \uae30\ub2e4\ub9bc\n        \/\/ The accept() function waits for client connections in a blocking state.\n        int client_socket = accept(server_fd, (struct sockaddr *)&amp;client_address, &amp;addrlen);\n        if (running.load() &amp;&amp; client_socket &lt; 0) { \/\/\n            perror(\"accept failed\");\n            continue; \/\/ \uc2e4\ud328\ud588\uc73c\uba74 \ub2e4\uc74c \ub8e8\ud504\ub97c \ub3cc\uba70 \uc7ac\uc2dc\ub3c4 \/ Retry in the next loop if it fails\n        }\n        \/\/ \ud074\ub77c\uc774\uc5b8\ud2b8 \uc811\uc18d \/ Client connected\n        std::thread client_thread(&#91;this, client_socket]() {\n            this-&gt;handle_client(client_socket); \/\/\uc678\ubd80\uc5d0\uc11c \uba54\uc138\uc9c0 \ubc14\uafb8\uae30\n        });\n\n        client_thread.detach();\n    }\n}\n\n\/\/ \ucee4\ub9e8\ub4dc \uc785\ub825 \ub8e8\ud504 \/ Command input loop \u2757\ufe0f\nvoid Server::run_cmd(){\n    std::string command;\n    while (true) {\n        std::cout &lt;&lt; \"CMD&gt; \"; \/\/ \uba85\ub839\uc5b4 \ud504\ub86c\ud504\ud2b8 \ud45c\uc2dc \/ Show command prompt\n\n        \/\/ std::getline\uc744 \uc0ac\uc6a9\ud558\uc5ec \uacf5\ubc31\uc744 \ud3ec\ud568\ud55c \uc804\uccb4 \ubb38\uc790\uc5f4\uc744 \ud55c \ubc88\uc5d0 \ubc1b\uc2b5\ub2c8\ub2e4.\n        \/\/ Use std::getline to get the entire string including spaces at once.\n        if (!std::getline(std::cin, command)) {\n            \/\/ EOF (Ctrl+C \ub4f1)\ub85c \uc785\ub825\uc744 \ubc1b\uc744 \uc218 \uc5c6\ub294 \uc0c1\ud669\uc774 \ubc1c\uc0dd\ud558\uba74 \uc885\ub8cc\n            \/\/ Terminate if input cannot be received due to EOF (Ctrl+C, etc.)\n            break;\n        }\n\n        \/\/ \uc785\ub825\ub41c \uba85\ub839\uc5b4\ub97c \ud655\uc778\ud569\ub2c8\ub2e4. \/ Check the input command\n        if (command.empty()) {\n            \/\/ \uc544\ubb34\uac83\ub3c4 \uc785\ub825\ud558\uc9c0 \uc54a\uc558\uc73c\uba74 \uadf8\ub0e5 \ub118\uc5b4\uac11\ub2c8\ub2e4.\/ If you don't enter anything, it will just skip.\n            continue;\n        } else if (command == \"\/exit\" || command == \"exit\") {\n\n            std::cout &lt;&lt; \"&#91;INFO] \uc885\ub8cc \uba85\ub839\uc744 \ubc1b\uc558\uc2b5\ub2c8\ub2e4. \uc11c\ube44\uc2a4 \uc885\ub8cc\ub97c \uc2dc\uc791\ud569\ub2c8\ub2e4.\\n\";\n            std::cout &lt;&lt; \"&#91;INFO] Received a shutdown command. Starting service shutdown.\\n\";\n            break; \/\/ \ub8e8\ud504 \uc885\ub8cc \/ Loop End\n\n        } else if (command == \"\/status\") {\n            std::cout &lt;&lt; \"&#91;STATUS] \uc11c\ube44\uc2a4\ub294 \uc815\uc0c1\uc801\uc73c\ub85c \uc791\ub3d9 \uc911\uc785\ub2c8\ub2e4.\\n\";\n            std::cout &lt;&lt; \"&#91;STATUS] The service is running normally.\\n\";\n        } else {\n            std::cout &lt;&lt; \"&#91;ERROR] \uc54c \uc218 \uc5c6\ub294 \uba85\ub839\uc5b4\uc785\ub2c8\ub2e4. (\/exit, \/status)\\n\";\n            std::cout &lt;&lt; \"&#91;ERROR] Unknown command. (\/exit, \/status)\\n\";\n        }\n    }\n}\n\n\/\/ \ub78c\ub2e4\uc2dd\uc73c\ub85c \uc678\ubd80\uc5d0\uc11c \ub0b4\uc6a9 \ubc14\uafb8\uae30\n\/\/ Change content from the outside using a lambda expression\nvoid Server::handle_client(int client_socket) {\n    char buffer&#91;1024];\n    std::cout &lt;&lt; \"&#91;Connection] New client connected.\" &lt;&lt; std::endl;\n\n    \/\/ 1. \ub370\uc774\ud130 \uc218\uc2e0 \/ receive data\n    ssize_t bytes_read = read(client_socket, buffer, sizeof(buffer) - 1);\n    if (bytes_read &gt; 0) {\n        buffer&#91;bytes_read] = '\\0';\n        std::string request = buffer;\n        std::cout &lt;&lt; \"&#91;Received] \" &lt;&lt; request.substr(0, 30) &lt;&lt; \"...\" &lt;&lt; std::endl;\n\n        std::string html_content;\n        if (logic_handler) {\n\n            \/\/ main\uc5d0\uc11c \ubcf4\ub0b8 \ub78c\ub2e4\uc2dd \uc2e4\ud589,request\ub294 \ubc84\ud37c\uc758 \uac12...\n            \/\/ Execute the lambda expression sent from main, request is the buffer value...\n            html_content = logic_handler(request);\n\n        } else {\n            html_content = \"&lt;h1&gt;No Logic Handler set!&lt;\/h1&gt;\";\n        }\n\n        \/\/ HTTP \ud3ec\ub9f7 \uc751\ub2f5 \/ send HTTP response\n        std::string response = \"HTTP\/1.1 200 OK\\r\\n\"\n                               \"Content-Type: text\/html; charset=utf-8\\r\\n\"\n                               \"Content-Length: \" + std::to_string(html_content.size()) + \"\\r\\n\"\n                               \"\\r\\n\" + html_content;\n\n        write(client_socket, response.c_str(), response.size());\n    }\n\n    \/\/ 2. \uc5f0\uacb0 \uc885\ub8cc (if\ubb38 \ubc16\uc73c\ub85c \uc774\ub3d9\ud558\uc5ec \ubb34\uc870\uac74 \ub2eb\ud788\uac8c \uc124\uc815)\n    \/\/ 2. Close connection (move outside the if statement and set to close unconditionally)\n    close(client_socket);\n    std::cout &lt;&lt; \"&#91;Connection] Client disconnected.\" &lt;&lt; std::endl;\n}\n\n\nbool Server::start() {\n    \/\/ \uc11c\ubc84\uac00 \uc2e4\uc81c\ub85c \uc791\ub3d9\ud558\ub294 \uba54\uc778 \ud568\uc218 \/ Main function that actually runs the server\n    try {\n        if (!running.load()) {\n            running.store(true);\n            run_listener();\n            return false;\n        }\n\n    } catch (const std::exception&amp; e) {\n        std::cerr &lt;&lt; \"&#91;ERROR] Server failed to start: \" &lt;&lt; e.what() &lt;&lt; std::endl;\n        return false;\n    }\n    return true;\n}\n\nvoid Server::stop() {\n\n    if (running.load() &amp;&amp; server_fd != -1) { \/\/\n        \/\/ \ud50c\ub798\uadf8\ub97c false\ub85c \uc124\uc815\ud558\uc5ec \ub8e8\ud504 \uc885\ub8cc \uc2e0\ud638 \uc804\uc1a1\n        \/\/ Set flag to false to send loop termination signal\n        running.store(false);\n        close(server_fd);\n        \/\/ \uc2e4\uc81c\ub85c\ub294 \uc5ec\uae30\uc11c \uc18c\ucf13\uc744 \ub2eb\uac70\ub098 \ub9ac\uc18c\uc2a4 \ud574\uc81c\ub97c \uc218\ud589\ud569\ub2c8\ub2e4.\n        \/\/ In practice, close the socket or release resources here.\n        server_fd = -1; \/\/ \ub2eb\uc558\uc73c\ubbc0\ub85c \ucd08\uae30\ud654 \/ Initialize to -1 after closing\n        std::cout &lt;&lt; \"&#91;Server] Shutdown initiated.\" &lt;&lt; std::endl;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>\u2714\ufe0f Router.h<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#ifndef ROUTER_H\n#define ROUTER_H\n\n#include &lt;string&gt;\n#include &lt;map&gt;\n#include &lt;functional&gt;\n#include &lt;utility&gt; \/\/ std::pair \uc0ac\uc6a9\uc744 \uc704\ud574 \ucd94\uac00 \/ add std::pair for use\n\nclass Router {\n    public:\n        Router(); \/\/ \uc0dd\uc131\uc790 \uc120\uc5b8 \/ constructor declaration\n        std::pair&lt;std::string, std::string&gt; router(const std::string&amp; request); \/\/ \ud568\uc218 \uc120\uc5b8 \/ function declaration\u2757\ufe0f\n    };\n\n#endif \/\/ ROUTER_H\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udc49\ud83c\udffb \uc8fc\uc694 \ubcc0\uacbd\uc0ac\ud56d\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.The major changes are as follows. \u2714\ufe0f \uae30\uc874\uc758 \ucee4\ub9e8\ub4dc \uc885\ub8cc \ubd80\ubd84\uc744 \ud568\uc218\ub85c \ubcc0\uacbd\ud588\uc2b5\ub2c8\ub2e4.(main.cpp)I changed the existing command termination part to a function. (main.cpp) \u2714\ufe0f \ub77c\uc6b0\ud130 \uc124\uc815 \ud30c\uc77c\uc744 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.I added the router configuration file. \u2714\ufe0f \ub77c\uc6b0\ud130\uc5d0 \ub9c8\uc784\ud0c0\uc785\uc744 \ucd94\uac00\ud588\uc2b5\ub2c8\ub2e4.(\uc544\uc9c1\uc740 body\ub9cc \ub9ac\ud134)Added MIME types to the router. (Currently only returns body) \ud83d\udc49\ud83c\udffb \uae30\uc874 \ucf54\ub4dc\uc5d0\uc11c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,1],"tags":[],"class_list":["post-5582","post","type-post","status-publish","format-standard","hentry","category-cpp","category-uncategorized","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/5582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=5582"}],"version-history":[{"count":1,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/5582\/revisions"}],"predecessor-version":[{"id":5583,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/5582\/revisions\/5583"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=5582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=5582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=5582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}