2 ms·
Check this file out, it's in the example that's provided: https://github.com/Taymindis/sample-ngx-cfunc-project/blob/master/ngx-cfunc-ggl-direction/src/main/Cfu
by drenvuk 8y ago
Check this file out, it's in the example that's provided:
https://github.com/Taymindis/sample-ngx-cfunc-project/blob/master/ngx-cfunc-ggl-direction/src/main/CfuncGglDirection.cpp https://github.com/Taymindis/sample-ngx-cfunc-project/blob/m...
I've stripped out everything of 'getRoute' and only provide a response of a global variable 'thing' that never changes.
std::string thing = "{\"result\": \"Hello World!\"}";
void getRoute(ngx_http_c_func_ctx_t* ctx) {
ngx_http_c_func_write_resp(
ctx,
200,
NULL,
ngx_http_c_func_content_type_json,
::thing.c_str(),
::thing.length()
);
}