News for hackers. Stuff that matters.
Re:Nginx C function by drenvuk on Monday October 15, 2018 @05:41PM (#18224069)
Check this file out, it's in the example that's provided: 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()
    );
  }

There are no comments on this comment yet.