Skip to content

🐶 Small, and basic http server, written in full C 🐸

License

Notifications You must be signed in to change notification settings

remirobert/rocko

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

screen shot 2016-05-11 at 15 54 58



Small, and basic http server, written in full C 😾 🐕. With a 🍰 API, easy to use like a ⚽️. Use the kevent for async socket. Available for OSX, or Free BSD.



⚠️ This project is under development ⭐️.

#Installation

Use CMake to generate a Makefile, and the compile the source.

cmake .
make

#How to use

//Include the rocko public API
#include "rocko.h"

//Create a function which defines your route.
//Keep in mind the prototype has to be this one.
//You get the request informations in parameters with the body.
struct response welcome(struct request req) {
    //Here you build your response.
    //Following this schema :
    //{response_code, body}
    return (struct response){R_200, "Welcome !"};
}

int main(int argc, char **argv) {
    //Initalise rocko server has to be call before everything
    rocko_init();
    
    //Add your routes here with your method, the request_uri, and your function
    rocko_add_route("GET", "/welcome", welcome);
    
    //Start and run the server with your port
    rocko_start(8080);
    return 0
}

###Todo 🦀💨

  • A lot of tests
  • Buffer cricular, for reading and write on the sockets
  • Upload, download files
  • Benchmark, with orther languages and frameworks

About

🐶 Small, and basic http server, written in full C 🐸

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages