Serenity Operating System
at master 28 lines 679 B view raw
1/* 2 * Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch> 3 * Copyright (c) 2022, Thomas Keppler <serenity@tkeppler.de> 4 * 5 * SPDX-License-Identifier: BSD-2-Clause 6 */ 7 8#include <WebServer/Configuration.h> 9 10namespace WebServer { 11 12static Configuration* s_configuration = nullptr; 13 14Configuration::Configuration(DeprecatedString document_root_path, Optional<HTTP::HttpRequest::BasicAuthenticationCredentials> credentials) 15 : m_document_root_path(move(document_root_path)) 16 , m_credentials(move(credentials)) 17{ 18 VERIFY(!s_configuration); 19 s_configuration = this; 20} 21 22Configuration const& Configuration::the() 23{ 24 VERIFY(s_configuration); 25 return *s_configuration; 26} 27 28}