2020-11-03 19:09:17 +01:00
|
|
|
;********************************
|
|
|
|
;*
|
|
|
|
;* lweb_header.pbi
|
|
|
|
;*
|
2020-11-30 09:52:27 +01:00
|
|
|
;* LiHaSo Webserver Modul Header/Declare
|
2020-11-03 19:09:17 +01:00
|
|
|
;*
|
2020-11-30 09:52:27 +01:00
|
|
|
;* It is usable as standalone Webserver, look at lwebd.pb
|
2020-11-03 19:09:17 +01:00
|
|
|
;*
|
|
|
|
;*
|
|
|
|
;*
|
|
|
|
|
|
|
|
EnableExplicit
|
2021-05-21 07:45:23 +02:00
|
|
|
XIncludeFile "lhs_lib/SYS/lhs_log.pbi"
|
|
|
|
|
2020-11-03 19:09:17 +01:00
|
|
|
CompilerIf #PB_Compiler_Thread = 0
|
|
|
|
CompilerError "Muss Threadsicher Kompiliert werden"
|
|
|
|
CompilerEndIf
|
|
|
|
|
|
|
|
DeclareModule lhs_web
|
|
|
|
;********************************
|
|
|
|
;*
|
|
|
|
;* Proceduren Deklarierung
|
|
|
|
;*
|
|
|
|
|
|
|
|
Enumeration e_conf
|
2020-11-30 10:04:29 +01:00
|
|
|
#conf_HTTP_port
|
|
|
|
#conf_HTTP_binding
|
2020-11-03 19:09:17 +01:00
|
|
|
#conf_defaultfile
|
|
|
|
#conf_basedir
|
|
|
|
#conf_error400
|
2020-11-30 10:04:29 +01:00
|
|
|
#conf_max_HTTP_clients
|
|
|
|
#conf_max_HTTPS_clients
|
2022-02-17 14:20:25 +01:00
|
|
|
#conf_File_max_in_Memory
|
|
|
|
#conf_File_BlockSize
|
2020-11-03 19:09:17 +01:00
|
|
|
#conf_server_type
|
|
|
|
#conf_cache_enable
|
2020-11-28 16:49:22 +01:00
|
|
|
#conf_HTTPS_CA
|
|
|
|
#conf_HTTPS_Cert
|
|
|
|
#conf_HTTPS_Key
|
|
|
|
#conf_HTTPS_Key_Pass
|
|
|
|
#conf_HTTPS_Port
|
|
|
|
#conf_HTTPS_Binding
|
|
|
|
#conf_HTTPS_Enable
|
2021-05-26 11:41:59 +02:00
|
|
|
#conf_debug_logfile
|
|
|
|
#conf_debug_disable
|
|
|
|
#conf_Access_logfile
|
|
|
|
#conf_Access_logUUID
|
|
|
|
#conf_Error_logfile
|
|
|
|
#conf_Error_logUUID
|
2021-06-06 09:49:08 +02:00
|
|
|
#conf_Cache_logfile
|
|
|
|
#conf_Cache_logUUID
|
2021-05-26 11:41:59 +02:00
|
|
|
#conf_runfile
|
2020-11-03 19:09:17 +01:00
|
|
|
EndEnumeration
|
|
|
|
|
2020-11-08 01:31:57 +01:00
|
|
|
Enumeration cli_handler 1
|
2020-11-03 19:09:17 +01:00
|
|
|
#handler_only ;Reagiert nur auf die Url (Bsp. /rest/v1/test aber nicht auf /rest/v1/test/sub)
|
|
|
|
#handler_sub ;Reagiert auf eine ganze Url die begint. (Bsp. /rest/v1/test sowie auch auf /rest/v1/test/sub)
|
2020-11-08 01:31:57 +01:00
|
|
|
#handler_type ;Reagiert auf datentypen (zb. *.php = "php")
|
2020-11-03 19:09:17 +01:00
|
|
|
EndEnumeration
|
|
|
|
|
2020-11-08 01:31:57 +01:00
|
|
|
Enumeration e_handler_prototype 1
|
|
|
|
#handler_proto_universal
|
|
|
|
#handler_proto_post
|
|
|
|
#handler_proto_get
|
|
|
|
EndEnumeration
|
|
|
|
|
|
|
|
Enumeration cli_handler_app 1
|
|
|
|
#app_handler_map_string ;.s App(Requested.s, Map HandlerMap.s())
|
|
|
|
#app_handler_json ;.s App(Requested.s, JSONString.s)
|
|
|
|
#app_handler_string ;.s App(Requested.s, String.s)
|
|
|
|
#app_handler_ressource ;.s App(Requested.s)
|
|
|
|
EndEnumeration
|
|
|
|
|
|
|
|
#response_string = "response_string"
|
|
|
|
#response_Memory = "response_memory"
|
|
|
|
|
|
|
|
|
|
|
|
;cli_handler_app Return:
|
|
|
|
;Map.s() to JSONString
|
|
|
|
#cha_R_ResponseType = "ResponseType" ;Element ResponseType :Mimetype
|
|
|
|
#cha_R_ResponseContentType = "ResponseContentType" ;Element ResponseContentType :#response_string , #response_Memory
|
|
|
|
#cha_R_MemoryAdress = "MemoryAdress" ;Element MemoryAdress :Converted to String
|
|
|
|
#cha_R_MemorySize = "MemorySize" ;Element MemorySize :Converted to String
|
|
|
|
#cha_R_StringBase64 = "StringBase64" ;Element StringBase64 :Base64 Encoded String
|
2022-02-14 15:00:13 +01:00
|
|
|
#cha_R_http_head_status = "HeaderStatus" ;200 OK 300 Error 500 Server Error usw.
|
2020-11-03 19:09:17 +01:00
|
|
|
#error_string = "error"
|
|
|
|
#http_head_method = "method"
|
|
|
|
#http_head_request = "request"
|
|
|
|
#http_head_protocol = "protocol"
|
|
|
|
#http_head_query = "query"
|
|
|
|
#http_head_status = "status"
|
|
|
|
#http_head_date = "date:"
|
|
|
|
#http_head_server = "server:"
|
|
|
|
#http_head_content_length = "content-length:"
|
|
|
|
#http_head_content_type = "content-type:"
|
|
|
|
#http_head_connection = "connection:"
|
|
|
|
#http_head_keep_alive = "keep-alive:"
|
2020-12-10 16:37:17 +01:00
|
|
|
#http_head_cookie = "cookie:"
|
|
|
|
#http_head_set_cookie = "set-cookie:"
|
2022-02-18 16:05:48 +01:00
|
|
|
#http_head_redirect = "location:"
|
2020-11-08 01:31:57 +01:00
|
|
|
|
|
|
|
#http_content_type_application_x_www_form_urlencoded = "application/x-www-form-urlencoded"
|
|
|
|
#http_content_type_multipart_form_data = "multipart/form-data"
|
|
|
|
|
2020-11-03 19:09:17 +01:00
|
|
|
Declare set_config(parameter.i=#conf_defaultfile, setting.s="index.html")
|
|
|
|
Declare.s get_config(parameter.i=#conf_defaultfile)
|
|
|
|
Declare start_server()
|
2020-11-08 01:31:57 +01:00
|
|
|
Declare.s register_client_handler(Route.s, Callback.i, AppPrototype.i = #handler_proto_get, RouteType.i = #handler_sub)
|
2020-12-01 15:17:48 +01:00
|
|
|
|
|
|
|
XIncludeFile "inc/lweb_IP_header.pbi"
|
|
|
|
XIncludeFile "inc/lweb_helper_header.pbi"
|
2020-11-03 19:09:17 +01:00
|
|
|
|
|
|
|
EndDeclareModule
|