diff --git a/app/Config/App.php b/app/Config/App.php index ecf4baa..99d7deb 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -16,7 +16,20 @@ class App extends BaseConfig * * E.g., http://example.com/ */ - public string $baseURL = 'http://localhost:8080/'; + public string $baseURL = ''; + + public function __construct() + { + parent::__construct(); + + if ($this->baseURL === '') { + $isHttps = ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'; + $scheme = $isHttps ? 'https' : 'http'; + $host = $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?? 'localhost'; + + $this->baseURL = $scheme . '://' . $host . '/'; + } + } /** * Allowed Hostnames in the Site URL other than the hostname in the baseURL. @@ -29,7 +42,11 @@ class App extends BaseConfig * * @var list */ - public array $allowedHostnames = []; + public array $allowedHostnames = [ + 'localhost', + 'hmskrishnaksp.dhms.in', + 'hmslocal.devsofttech.co.in', + ]; /** * -------------------------------------------------------------------------- diff --git a/app/Views/report/index.php b/app/Views/report/index.php index c6fe6ba..b6eaf1f 100644 --- a/app/Views/report/index.php +++ b/app/Views/report/index.php @@ -5,6 +5,21 @@
+