New Currently working lweb server enviroment

This commit is contained in:
René Linder 2023-03-29 10:47:34 +02:00
parent fe28ebae1c
commit ba837a4825

View file

@ -4,17 +4,19 @@
;* ;*
;* HTTP/HTTPS example extended Server ;* HTTP/HTTPS example extended Server
;* ;*
;* (c)2015 - 2021 by Linder Hard- und Software ;* (c)2015 - 2023 by Linder Hard- und Software
;* ;*
;* ;*
EnableExplicit EnableExplicit
OpenConsole("server_example Console")
PrintN("Server_Sample and tests")
;* ;*
;* Includes: ;* Includes:
;* ;*
XIncludeFile "lhs_lib/SYS/lhs_log_ext.pbi" ;User for Access Log, Error Access Log, Error Log and maybe more. XIncludeFile "lhs_lib/SYS/lhs_log_ext.pbi" ;User for Access Log, Error Access Log, Error Log and maybe more.
XIncludeFile "lhs_lib/SYS/lhs_sys_debug_wrapper.pbi"
XIncludeFile "lweb_header.pbi" XIncludeFile "lweb_header.pbi"
XIncludeFile "lweb.pbi" XIncludeFile "lweb.pbi"
@ -23,37 +25,54 @@ XIncludeFile "lweb.pbi"
;* ;*
Define counter, v_lweb_srv_stop Define counter, v_lweb_srv_stop
Global Accesslog.s, Errorlog.s, Cachelog.s, DebugLog.s Global Accesslog.s, Errorlog.s, Cachelog.s, DebugLog.s, Debuggings.s
;* ;*
;* Enable extended Logging: ;* Enable extended Logging:
;* ;*
DebugLog = lhs_log_ext::Create("DebugLog") DebugLog = lhs_log_ext::Create("DebugLog")
lhs_log_ext::SetLogFile(DebugLog, "http-s_debug.log") lhs_log_ext::SetLogFile(DebugLog, "lweb_debug.log")
lhs_log_ext::Init(DebugLog) lhs_log_ext::Init(DebugLog)
lhs_web::set_config(lhs_web::#conf_Debug_logUUID, DebugLog) ldl::Register(lhs_log_ext::@Out(), DebugLog, 1, DebugLog, ldl::#AdvancedLog)
ldl::SetDefault(DebugLog)
ldl::Logging("Start Debug Log registered with ldl at UUID:"+DebugLog)
Debuggings = lhs_web::get_config(lhs_web::#conf_Debug_logUUID)
Debug Debuggings
;* ;*
;* includes ;* includes
;* ;*
XIncludeFile "server_example_function.pbi" XIncludeFile "server_example_function.pbi"
PrintN("Read Configuration:")
;* ;*
;* Start http & https Server ;* Read Configuration http & https Server
;* ;*
If lhs_web::server_initial("cfg/server_config.xml") If lhs_web::server_initial("cfg/server_config.xml")
lhs_log_ext::OutL(DebugLog, lhs_log_ext::#Info, "config succesfully loaded.") ldl::Logging("config succesfully loaded.")
Else Else
lhs_log_ext::OutL(DebugLog, lhs_log_ext::#Error, "config load failed.") ldl::Logging("config load failed.")
End End
EndIf EndIf
PrintN("HTTP an Port:"+lhs_web::server_get_config("ports_http"))
PrintN("HTTPS an Port:"+lhs_web::server_get_config("ports_https"))
PrintN("Configuration read done.")
;*
;* Start Server
;*
PrintN("Start the Server")
If lhs_web::server_start()
ldl::Logging("Server started")
Else
ldl::Logging("Start failed.")
End
EndIf
counter = 0 counter = 0
OpenConsole("Test") PrintN("Server_Sample started.")
PrintN("Server_Sample and tests")
PrintN("HTTP an Port:"+lhs_web::get_config(lhs_web::#conf_HTTP_port))
PrintN("HTTPS an Port:"+lhs_web::get_config(lhs_web::#conf_HTTPS_Port))
PrintN("Press Enter to Exit") PrintN("Press Enter to Exit")
Input() Input()
lhs_log_ext::StopAllLogger() lhs_log_ext::StopAllLogger()