kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

generic.conf (1347B)



      1 # Placeholder configuration
      2 
      3 server tls {
      4 	bind 127.0.0.1 8888
      5 }
      6 
      7 load		./generic.so		example_load
      8 
      9 http_body_max			1024000000
     10 http_body_disk_offload		1024000
     11 
     12 validator	v_example	function	v_example_func
     13 validator	v_regex		regex		^/test/[a-z]*$
     14 validator	v_number	regex		^[0-9]*$
     15 validator	v_session	function	v_session_validate
     16 
     17 authentication auth_example {
     18 	authentication_type		cookie
     19 	authentication_value		session_id
     20 	authentication_validator	v_session
     21 	authentication_uri		/private
     22 }
     23 
     24 domain * {
     25 	attach		tls
     26 
     27 	certfile	cert/server.pem
     28 	certkey		cert/key.pem
     29 	accesslog	kore_access.log
     30 
     31 	route /css/style.css {
     32 		handler asset_serve_style_css
     33 		methods get
     34 	}
     35 
     36 	route / {
     37 		handler asset_serve_index_html
     38 		methods get
     39 	}
     40 
     41 	route /intro.jpg {
     42 		handler asset_serve_intro_jpg
     43 		methods get
     44 	}
     45 
     46 	route /b64test {
     47 		handler serve_b64test
     48 		methods get
     49 	}
     50 
     51 	route /upload {
     52 		handler serve_file_upload
     53 		methods get post
     54 	}
     55 
     56 	route /validator {
     57 		handler serve_validator
     58 		methods get
     59 	}
     60 
     61 	route /params-test {
     62 		handler serve_params_test
     63 		methods get post
     64 
     65 		validate qs:get arg1 v_example
     66 		validate qs:get id v_number
     67 
     68 		validate post test1 v_example
     69 		validate post test2 v_regex
     70 	}
     71 
     72 	route /private {
     73 		handler serve_private
     74 		methods get
     75 	}
     76 
     77 	route /private/test {
     78 		handler asset_serve_private_test_html
     79 		authenticate auth_example
     80 	}
     81 }