A lightweight http server framework written in C3 powered by c3io and libuv, inspired by Hono and express.js.
- Simple routing system with HTTP method support
- GET
- POST
- PUT
- PATCH
- DELETE
- TRACE
- CONNECT
- Content type handling (HTML, JSON, TXT, AAC)
- Basic request/response handling
- Static file serving capability
module main;
import std::io;
import ceb;
fn int main() {
Server server;
server.init();
defer server.start();
server
.get("/heyo",
fn (
Request req
) => {
.status = 200,
.status_text = StatusText.OK,
.data = dstring::temp("Hello World"),
.content_type = ContentType.TXT
}
)
io::printf("Server starting...\n");
return 0;
}Make sure you have C3 compiler installed, then:
c3c buildThe output binary will be available in the build directory.
src- Source code filessrc/main.c3- Entry pointsrc/ceb.c3- Core server implementationsrc/enums.c3- HTTP-related enums and constants
build- Compiled outputresources- Static resourcestest- Test files
- Early prototype stage
- Not optimized for production use
- Limited error handling
- No security features implemented
- Limited request parsing capabilities
- No SSL/TLS support
This project is in active development and should be considered alpha software. It is primarily intended for:
- Experimenting with web server concepts
- Understanding low-level networking
Do not use this in production environments.