I'm searching a cgi lib in C to build a restfu

2019-07-04 05:33发布

问题:

I want to build a restful (CoAP) web service which can execute c code to handle events.

Therefore I'm searching a lib which provides me with a rest api in C and cgi similar to restcgi which is sadly in c++ or CGI-Simple which is in perl.

The server is running on a embedded device so it has very limited resources and the services will be accessed only by machines.

Thank you very much.

回答1:

You may be interested in Raphters framework and its architecture. It's pretty small, so you can examine the code, the framework itself can be used as a FastCGI backend for some web server, e.g. for nginx.



回答2:

I have recently came across one quite interesting CoAP library which uses libevent. You will aslo want to check Klone embeddable HTTP server by the same guys at KoanLogic. I have previously looked at libcoap, but it didn't find it very usable at the time. You may also wish to try using either libuv, libev or (libevent)[http://libevent.org]. But I guess it's probably gonna be much easier to adopt some of the code from WT repository and get your CoAP/HTTP server done.



标签: c rest cgi core