forked from mirrors/kore
Add a readme to parameters + update some text
This commit is contained in:
parent
4a7653f195
commit
b3f65ae13f
14
examples/parameters/README.md
Normal file
14
examples/parameters/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
Example on how to handle GET/POST parameters in Kore.
|
||||
|
||||
Run:
|
||||
```
|
||||
# kore run
|
||||
```
|
||||
|
||||
Test:
|
||||
```
|
||||
# curl -i -k https://127.0.0.1:8888/?id=123123
|
||||
```
|
||||
|
||||
The output will differ based on wether or not id is a valid
|
||||
u_int16_t number or not. (the string should always be present).
|
@ -17,6 +17,10 @@ domain 127.0.0.1 {
|
||||
static / page
|
||||
|
||||
# The parameters allowed for "/" (GET method).
|
||||
#
|
||||
# If you would want to declare parameters available
|
||||
# to the page handler for POST, swap the 'get' setting
|
||||
# to 'post' instead, Kore takes care of the rest.
|
||||
params get / {
|
||||
# Validate the id parameter with the v_id validator.
|
||||
validate id v_id
|
||||
|
Loading…
Reference in New Issue
Block a user