Linuxで実行されているC ++ 20エコーWebサーバー。
ユーザーがname <user>とメッセージ<msg>を入力した場合、サーバーは<user> said "<msg>"と返信します。
場所をプロジェクトフォルダーに設定して実行します。
docker image build . -t < image > <image> 、カスタムDocker画像名に置き換える必要があります。
docker container run < image > ctest --test-dir .. -VVconfig.yamlはデフォルトの構成です。建物中にDockerにコピーされます。
server :
# The TCP listening port.
port : 10000
# The website folder.
asset_folder : " assets "
# The maximum alive time for client timers (in seconds).
# When a client's timer reaches zero and it has no activity, it will disconnect.
alive_time : 60
loggers :
- name : root
level : info
appenders :
- type : stdout新しい構成を効果的にする2つの方法を以下に示します。
config.yaml変更し、新しいDocker画像を作成します。build/bin/config.yaml変更します。ロガー構成を変更する場合は、詳細についてはsrc/log/README.mdを参照してください。
docker container run -p < container-port > : < host-port > < image > <container-port> 、 config.yamlのserver.portに等しくなければなりません。 <host-port>ホストマシンの利用可能なポートにすることができます。 -p <container-port>:<host-port>ホストマシンの<host-port>にコンテナの<container-port>をバインドします。
サーバーの実行後、ブラウザを開き、ホストマシンでhttp://localhost:<host-port>にアクセスして使用します。
次のコマンドを実行し、デフォルトの構成を使用している場合はhttp://localhost:10000にアクセスできます。
docker container run -p 10000:10000 < image > ユニットテストは、パブリックテストとプライベートテストで構成されるGoogletestフレームワークを使用して実行されます。
testsフォルダーにあります。ユニットテストファイルの名前は_testで終了します。
コードコメントスタイルは、ドキシゲン仕様に従います。
クラス図は、人魚の仕様に従います。
.
├── CITATION.cff
├── CMakeLists.txt
├── Dockerfile
├── LICENSE
├── README.md
├── .github
│ └── workflows
│ └── cmake-googletest.yaml
├── assets
│ ├── favicon.ico
│ ├── http-status.html
│ └── index.html
├── config.yaml
├── docs
│ └── badges
│ ├── C++.svg
│ ├── License-MIT.svg
│ ├── Linux.svg
│ ├── Made-with-CMake.svg
│ ├── Made-with-GitHub-Actions.svg
│ └── Made-with-Docker.svg
├── include
│ ├── config.h
│ ├── containers
│ │ ├── block_deque.h
│ │ ├── buffer.h
│ │ ├── epoller.h
│ │ ├── heap_timer.h
│ │ └── thread_pool.h
│ ├── http.h
│ ├── io.h
│ ├── ip.h
│ ├── log.h
│ ├── test_util.h
│ ├── util.h
│ └── web_server.h
├── src
│ ├── CMakeLists.txt
│ ├── config
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── config.cpp
│ ├── containers
│ │ ├── CMakeLists.txt
│ │ ├── buffer
│ │ │ ├── CMakeLists.txt
│ │ │ ├── README.md
│ │ │ └── buffer.cpp
│ │ ├── epoller
│ │ │ ├── CMakeLists.txt
│ │ │ └── epoller.cpp
│ │ └── thread_pool
│ │ ├── CMakeLists.txt
│ │ └── thread_pool.cpp
│ ├── http
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── http.cpp
│ │ ├── request.cpp
│ │ ├── request.h
│ │ ├── request_test.cpp
│ │ ├── response.cpp
│ │ ├── response.h
│ │ └── response_test.cpp
│ ├── io
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── io.cpp
│ ├── ip
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── ip.cpp
│ ├── log
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── appender.cpp
│ │ ├── config_init.cpp
│ │ ├── config_init.h
│ │ ├── config_init_test.cpp
│ │ ├── field.cpp
│ │ ├── field.h
│ │ ├── field_test.cpp
│ │ └── log.cpp
│ ├── main.cpp
│ ├── test_util
│ │ ├── CMakeLists.txt
│ │ └── test_util.cpp
│ └── util
│ ├── CMakeLists.txt
│ └── util.cpp
└── tests
├── CMakeLists.txt
├── config_test.cpp
├── containers
│ ├── block_deque_test.cpp
│ ├── buffer_test.cpp
│ ├── heap_timer_test.cpp
│ └── thread_pool_test.cpp
├── http_test.cpp
├── io_test.cpp
├── ip_test.cpp
├── log_test.cpp
└── util_test.cpp
MITライセンスの下で配布されます。詳細については、 LICENSE参照してください。