A C++ school project for 42 Codam
webserv
is a lightweight non-blocking HTTP/1.1 web server written in C++. It uses Nginx-like configuration syntax. It makes use of epoll
for the event management
- Supports HTTP/1.1
- Nginx-like configuration syntax
- CGI (currently only python)
- Custom error pages
- File uploads
- Autoindex (directory listing)
log_level debug;
http {
server {
listen 8080;
server_name localhost;
error_page 404 /error/404.html;
error_page 400 505 /error/400.html;
location /upload/ {
root www/default;
upload_dir www/default/upload/;
autoindex on;
}
location / {
root www/default;
index index.html;
autoindex on;
}
}
}
To build in debug mode:
make debug
For a release build:
make release
After building, you can start the server with:
./webserv
By default, it will look for a configuration file. You can specify a custom configuration file:
./webserv path/to/config.conf
To run unit tests using Docker:
make test
To run E2E tests:
make e2e
To remove compiled objects:
make clean
To remove all build artifacts:
make fclean
To rebuild everything from scratch:
make re
To format the codebase using clang-format
:
make format