added example code for using AqCGI.

This commit is contained in:
Martin Preuss
2025-12-27 13:20:58 +01:00
parent 08c0dab8ba
commit 9e2ce1c94a

View File

@@ -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();
```