config - ryhara/Webserv GitHub Wiki

仕様

クラス

  • Config
    複数のサーバー情報(ServerConfig)を持つ
  • ConfigParse
    Configを持ち、実際にパースする
  • Location
    一つ分のlocation情報を持つ
  • ServerConfig
    一つ分のサーバー情報を持つ(複数のLocationを持つ)

Locationクラス 初期値

要素 初期値
location /
get_method true
post_method false
delete_method false
autoindex false
alias ./www/
index index.html
upload_path ./www/uploads/
redir_path ""
cgi_extension ""

ServerConfigクラス 初期値

要素  初期値
port 80
server_name default
max_body_size 2048
error_page ./www/error_page/404.html
location

実行方法

Server server;
ConfigParse configParse(server.getConfig());
configParse.parse(file_name);

サーバー情報の表示

printServerInfo(server.getConfig().getServers());