Added some basic CGI support using kcgi plus a lot of fixes and content updates. (0.41.9)
This commit is contained in:
parent
9698074279
commit
604c415c0c
25 changed files with 407 additions and 13 deletions
14
examples/cgi/hello_kcgi.fun
Normal file
14
examples/cgi/hello_kcgi.fun
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env fun
|
||||
|
||||
/*
|
||||
* Minimal example using KCGI wrapper.
|
||||
* Run under a CGI/FastCGI environment where kcgi can parse the request.
|
||||
*/
|
||||
|
||||
#include <net/kcgi.fun>
|
||||
|
||||
cgi = KCGI()
|
||||
name = cgi.get_or("name", "Fun")
|
||||
|
||||
body = "<h1>Hello, " + to_string(name) + "!</h1>"
|
||||
cgi.reply(200, "text/html; charset=utf-8", body)
|
||||
Loading…
Add table
Add a link
Reference in a new issue