https://github.com/xirzo/websiteinc
Website written in C
https://github.com/xirzo/websiteinc
c nojavascript website
Last synced: 6 months ago
JSON representation
Website written in C
- Host: GitHub
- URL: https://github.com/xirzo/websiteinc
- Owner: xirzo
- Created: 2025-02-28T19:11:14.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-22T15:08:24.000Z (8 months ago)
- Last Synced: 2025-06-22T16:25:01.910Z (8 months ago)
- Topics: c, nojavascript, website
- Language: Dockerfile
- Homepage:
- Size: 57.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🖥️C-Website
[](https://en.wikipedia.org/wiki/C_(programming_language))
[](https://cmake.org/)
> [!WARNING]
> This project was created for educational purposes and demonstration only.
> The code is not production-grade and may have significant limitations, bugs, or security issues.
> **Do not use this :)**
This project aims to create a fully functional website using the C programming language.

## ✨ Features
- **Pure C Implementation**: Built using standard C libraries and minimal dependencies
- **Simple HTTP Server**: Handles basic HTTP requests and serves static content
- **Routing System**: Maps URLs to file resources
## 🛠 Requirements
- ⚙️ GCC compiler (clang won`t work)
- 🛠 CMake (version 3.10 or higher)
- 📦 [Http Parser Library](https://github.com/xirzo/httpparser)
## 🔧 Building
```bash
git clone https://github.com/xirzo/WebsiteInC
cd WebsiteInC
mkdir build
cd build
cmake .. --preset=gcc
make
```
## 🚀 Usage
After building, set the port env and run the server:
```bash
export PORT=5000
```
```bash
./c_website
```
The server will start on port 5000 by default. You can access the website at `http://localhost:5000`.
## ⚙️ How It Works
The router maps the requested URI to a file. Then the server uses a simple HTTP parser to process incoming requests. When a request comes in, the router provides a file path then server reads the file and sends it back as an HTTP response.
Current routes:
- `/` → `index.html`
- `/style.css` → `style.css`