mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00

This moves the configuration of the web server, which currently only consists of the root path, into a new class, Configuration. Since the configuration is global and not per client, it is accessed by a singleton getter. This change simplifies future extensions of the configurable parameters.
27 lines
452 B
C++
27 lines
452 B
C++
/*
|
|
* Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/String.h>
|
|
|
|
namespace WebServer {
|
|
|
|
class Configuration {
|
|
public:
|
|
Configuration(String root_path);
|
|
|
|
String const& root_path() const { return m_root_path; }
|
|
|
|
void set_root_path(String root_path) { m_root_path = move(root_path); }
|
|
|
|
static Configuration const& the();
|
|
|
|
private:
|
|
String m_root_path;
|
|
};
|
|
|
|
}
|