logger, ApiServerState apiServerState)
{
_log = logger;
serverState = apiServerState;
}
///
/// Server landing page
///
///
[AllowAnonymous]
[HttpGet]
public ContentResult Index()
{
var errorBlock = string.Empty;
if (serverState.IsSystemLocked)
{
errorBlock = $@"SERVER ERROR
{serverState.Reason}
";
}
var resp = $@"
AyaNova server
{errorBlock}
{AyaNovaVersion.FullNameAndVersion}
";
/*
head had this:
probably for signature page
{await TranslationBiz.GetDefaultTranslationAsync("HelpLicense")}
{AyaNova.Core.License.LicenseInfo}
Schema version
{AySchema.currentSchema.ToString()}
Active techs
{await UserBiz.ActiveCountAsync()}
Server time
{DateUtil.ServerDateTimeString(System.DateTime.UtcNow)}
{TimeZoneInfo.Local.Id}
Server logs
{ServerBootConfig.AYANOVA_LOG_PATH}
*/
return new ContentResult
{
ContentType = "text/html",
StatusCode = 200,
Content = resp
};
}
#region sigtest script
/*
SIGTEST - 1
This is the signature header
{SigScript()}
private string SigScript(){
return @"";
}
*/
#endregion
///
/// Get API server info for general display
///
/// API server info
[HttpGet("server-info")]
public ActionResult ServerInfo()
{
return Ok(new
{
data = new
{
ServerVersion = AyaNovaVersion.FullNameAndVersion,
DBSchemaVersion = AySchema.currentSchema,
ServerLocalTime = DateUtil.ServerDateTimeString(System.DateTime.UtcNow),
ServerTimeZone = TimeZoneInfo.Local.Id,
License = AyaNova.Core.License.LicenseInfoAsJson
}
});
}
#if (DEBUG)
///
/// Get build mode of server, used for automated testing purposes
///
/// "DEBUG" or "RELEASE"
[HttpGet("build-mode")]
public ActionResult BuildMode()
{
return Ok(new { data = new { BuildMode = "DEBUG" } });
}
#else
///
/// Get build mode of server, used for automated testing purposes
///
/// "DEBUG" or "RELEASE"
[HttpGet("build-mode")]
public ActionResult BuildMode()
{
return Ok(new { data = new { BuildMode = "RELEASE" } });
}
#endif
}
}