added example code for using AqCGI.
This commit is contained in:
20
README.md
20
README.md
@@ -15,6 +15,7 @@ AqCGI only depends on libgwenhywfar (see [gwenhywfar](https://www.aquamaniac.de/
|
||||
|
||||
### Build
|
||||
Download and unpack tar.gz file, CD into the unpacked folder and build like this:
|
||||
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
@@ -23,3 +24,22 @@ gwbuild -jNN (with NN being the number of parallel processes to use, e.g. 4 if c
|
||||
sudo gwbuild -i
|
||||
```
|
||||
|
||||
## Use AqCGI
|
||||
|
||||
Working with AqCGI is as simple as this (in your main() function):
|
||||
|
||||
```
|
||||
AQCGI_REQUEST *rq;
|
||||
|
||||
DBG_ERROR(NULL, "Init CGI");
|
||||
AQCGI_Init();
|
||||
rq=AQCGI_ReadRequest();
|
||||
if (rq) {
|
||||
// do something with the request
|
||||
|
||||
AQCGI_SendResponseWithStatus(rq, 200, "Ok");
|
||||
AQCGI_Request_free(rq);
|
||||
}
|
||||
AQCGI_Fini();
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user