lweb/lweb_header.pbi

97 lines
3.3 KiB
Text
Raw Normal View History

;********************************
;*
;* lweb_header.pbi
;*
2020-11-30 09:52:27 +01:00
;* LiHaSo Webserver Modul Header/Declare
;*
2020-11-30 09:52:27 +01:00
;* It is usable as standalone Webserver, look at lwebd.pb
;*
;*
;*
EnableExplicit
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
#conf_defaultfile
#conf_basedir
#conf_error400
2020-11-30 10:04:29 +01:00
#conf_max_HTTP_clients
#conf_max_HTTPS_clients
#conf_server_type
#conf_cache_enable
#conf_HTTPS_CA
#conf_HTTPS_Cert
#conf_HTTPS_Key
#conf_HTTPS_Key_Pass
#conf_HTTPS_Port
#conf_HTTPS_Binding
#conf_HTTPS_Enable
EndEnumeration
Enumeration cli_handler 1
#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)
#handler_type ;Reagiert auf datentypen (zb. *.php = "php")
EndEnumeration
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
#cha_R_http_head_status = "HeaderStatus" ;200 OK 300 Error 500 Server Error usw.
#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:"
#http_content_type_application_x_www_form_urlencoded = "application/x-www-form-urlencoded"
#http_content_type_multipart_form_data = "multipart/form-data"
Declare set_config(parameter.i=#conf_defaultfile, setting.s="index.html")
Declare.s get_config(parameter.i=#conf_defaultfile)
Declare start_server()
Declare.s register_client_handler(Route.s, Callback.i, AppPrototype.i = #handler_proto_get, RouteType.i = #handler_sub)
Declare.s mimetype(file.s)
Declare.s MapToJSONString(Map ConvertMap.s())
Declare IsIPStringValid(Adress.s)
EndDeclareModule