Configuration.cpp 469 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2021, Max Wipfli <mail@maxwipfli.ch>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <WebServer/Configuration.h>
  7. namespace WebServer {
  8. static Configuration* s_configuration = nullptr;
  9. Configuration::Configuration(String root_path)
  10. : m_root_path(move(root_path))
  11. {
  12. VERIFY(!s_configuration);
  13. s_configuration = this;
  14. }
  15. Configuration const& Configuration::the()
  16. {
  17. VERIFY(s_configuration);
  18. return *s_configuration;
  19. }
  20. }