<?php

namespace SHServ\Controllers;

class AppController extends \SHServ\Middleware\Controller {
	public function index() {
		$indexPath = __DIR__ . '/../../dist/index.html';
		if (file_exists($indexPath)) {
			header('Content-Type: text/html; charset=utf-8');
			readfile($indexPath);
			return;
		}
		$server_version = FCONF["version"];
		return "Smart home server. <br>Version {$server_version}";
	}

	public function text_msgs() {
		return $this -> utils() -> response_success([
			"text_msgs" => FCONF["text_msgs"]
		]);
	}
}