Skip to content

Velvet is a C library for creating HTTP servers and web applications.

License

Notifications You must be signed in to change notification settings

liptaciak/velvet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b2dd61b · Nov 7, 2024

History

19 Commits
Oct 24, 2024
Nov 7, 2024
Nov 7, 2024
Apr 28, 2024
Apr 19, 2024
Oct 24, 2024
Oct 24, 2024
Nov 7, 2024

Repository files navigation

Velvet - HTTP Library written in C

GPLv3 License GitHub top language GitHub Repo stars

Velvet is a simple HTTP library / Web server for C/C++.

Usage/Examples

Example code below creates a route at "/" and listens at port 8080:

#include <velvet.h>

velvet_response_t route(velvet_request_t req) {
    velvet_response_t response = {
        .code = 200,
        .content_type = "text/plain",
        .content = "Hello World!"
    };

    return response;
}

int main(int argc, char **argv) {
    velvet_app_t* app = velvet_create_app();
    
    velvet_method_t method = GET;
    velvet_add_route(app, method, "/", route);

    velvet_listen(app, 8080);
}

About

Velvet is a C library for creating HTTP servers and web applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published