Skip to content

fh-dualies/http-c-erver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-c-server

Projekt Systementwicklung (Sommersemester 2024) - FH Münster


Overview

Members

About this repository

Top-level layout

This repository's contents is divided across following primary sections:

  • /assets contains assets used for general purposes
  • /build contains compiled files generated by cmake
  • /git-hooks contains git hooks. (Installed using ./scripts/install-git-hooks.sh)
  • /lib contains third-party & own libraries used in the project
  • /scripts contains scripts used for general purposes
  • /src contains the source code for the project
  • /src/htdocs represents the root directory of the server
  • /tests contains the test code for the project

Libs

  • file_lib is a library that provides functions for file handling
  • string_lib is a library that provides functions for string handling
  • testing is a library that provides functions for testing

Modules

  • http_models is a module that provides models for HTTP requests and responses
  • http_parser is a module that provides a parser for HTTP requests and urls
  • http_router is a module that provides a router for HTTP requests
  • http_server is a module that provides a basic HTTP server

Installation

Clone the repository

$ git clone https://github.com/fh-dualies/http-c-erver.git

Switch to "http-c-erver" folder

$ cd http-c-erver

Init using cmake

$ cmake .

Compile http-c-erver

$ make

Configuration

Configure http server

The http server can be configured by changing the values in the main.h file. These are only general configurations. For more specific configurations, the server itself must be modified (look for constants in *.h files).

Run Project

Run http server

The http server will process the request information and send a response back to the client.

$ ./build/server.out

How to test

Run unit tests

$ ./build/tests.out

Run http tests

Note that python3 is required to run the tests.

$ pyhton3 tests/http/tests.py

Test output

Red: Assertion failed
Green: Assertion passed

Conventions

Formatting

This project uses clang-format to enforce a consistent code style. To format your code, run the following command:

./scripts/format.sh

Commit messages

This project uses Conventional Commits to enforce a consistent commit message style.

This might help to write better commit messages: Commitlint.io