Skip to content

Effortlessly serve web content with our efficient and easy-to-use Simple Web Server.

Notifications You must be signed in to change notification settings

kingieX/simple-web-server

Repository files navigation

Simple Web Server

This repository contains C code for a simple web server using the Libuv library. The web server can serve static files from a directory on the server and handle HTTP GET requests for these files.

Prerequisites:

  • Ubuntu operating system
  • GCC compiler
  • Libuv library

Installation

Install Libuv library(for this project we used version 1.44.2)

Compiling and Running the Code

  1. Clone the repository to your local machine
  2. Change into the simple-web-server directory
  3. Compile the server code using GCC: gcc -o server main.c -luv
  4. Start the server: ./server

Usage

  • The server listens on port 80 by default.
  • The server can serve static files from a directory named "public" in the root directory of the project.
  • To request a file, enter the URL in the web browser in the format: http://localhost:80/filename
  • The server will respond with the requested file or a 404 error message if the file is not found.

Contributing

  • If you find any bugs or issues with the code, feel free to open a new issue or submit a pull request.
  • All contributions are welcome!

Acknowledgements

This code was inspired by the ALX software enginering programme and will serve as our first portfolio project

AUTHORS

  1. Naod Ararsa

  2. Stephen Obialor

  3. Chima Nnach

About

Effortlessly serve web content with our efficient and easy-to-use Simple Web Server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages