CWebStudio is a powerful and lightweight framework for building web applications in C/C++. Designed for efficiency and simplicity, it provides a single-file library to streamline common web development tasks. With CWebStudio, you can effortlessly handle HTTP requests, parse JSON, manage static files, and create dynamic front-end code using the innovative HyDration mechanic. Whether you're developing a simple API or a complex web application, CWebStudio equips you with the tools to build fast and reliable solutions.
———
🚀 Features
Lightweight & Efficient: A minimal footprint with maximum performance.
Single-File Library: Easy to integrate with your projects.
HTTP Request Handling: Simplified management of routes, headers, and query parameters.
JSON Parsing: Built-in support for handling JSON data with ease.
Static File Management: Serve static files with smart caching.
HyDration Mechanic: Generate dynamic front-end code directly from C.
Cross-Platform: Compatible with multiple environments for C/C++ development.
———
📦 Releases
ItemDescription
CWebStudio One file (All-in-one solution)
Header File
Full Folder (Includes src/one.c)
———
💻 Quick Start: Simple Example
Here's a minimal example to get you started with CWebStudio. This code sets up a basic server that responds with "Hello World".
#include"CWebStudioOne.c"CwebHttpResponse*main_server(CwebHttpRequest*request) { returncweb_send_text("Hello World", 200); } intmain(intargc, char*argv[]) { CwebServerserver=newCwebSever(5000, main_server); CwebServer_start(&server); return0; }
———
📚 Documentation
Explore the comprehensive documentation to learn more about CWebStudio's capabilities:
TopicDescription
How to build and install CWebStudio
Working with URL parameters
Retrieving query parameters
Iterating through query parameters
Parsing URL-encoded parameters
Retrieving request headers
Iterating through headers
Reading body content from requests
Parsing JSON data from requests
Returning JSON using cJSON
Reading binary content from requests
Returning plain text responses
Returning HTML using CTextStack
Returning raw HTML responses
Returning files directly from the server
Returning content in various formats
Handling static files with smart caching
Enabling debug mode with CWEB_DEBUG
Killing the server process
Configuring server parameters
Introduction to HyDration for front-end code
Explaining the three steps of HyDration
Full runnable HyDration example
Retrieving search results from the browser
Setting up search requirements for bridges
Executing actions in the browser
Using shortcuts in HyDration
Passing arguments between bridges
Handling numbers in HyDration
Required dependencies for CWebStudio
———
🤝 Contributing
We welcome contributions to CWebStudio! If you'd like to contribute, please fork the repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss your ideas.
———
📜 License
CWebStudio is licensed under the MIT License. See the
file for more details.
———
🌟 Why CWebStudio?
CWebStudio brings the power of C/C++ to web development, combining performance with simplicity. Whether you're building embedded web servers or high-performance APIs, CWebStudio is the ideal choice for developers who value efficiency and control.
———