Complete Suite of Embedded Web Development Tools
|
One of the options for developing server-side generated web pages is to use what we refer to as C Server Pages (CSP). CSP is designed for dynamically generating HTML on the server, making it similar to technologies like JSP, PHP, and ASP. CSP allows embedding C or C++ code directly in HTML template files using special CSP tags. The Barracuda Embedded Web Server SDK provides host tools that process these CSP files, converting them into C or C++ code, which is then compiled and linked with your application. This enables efficient generation of dynamic content within HTML pages. However, CSP is typically not used to handle AJAX and REST requests. The Barracuda Embedded Web Server provides a far more efficient and streamlined approach, allowing you to quickly implement RESTful APIs and AJAX endpoints directly in C and C++. The server can handle REST requests with minimal overhead by leveraging the built-in directory object. CSP Page Counter Example: <%! int count; %> <%!! count = 1; %> <html> <body> <p> You are visitor <%="%d" count++%>. </p> </body> </html>
|
In modern web development, iterative testing during development is essential. However, compiling C code for every change can slow down the process and add unnecessary complexity. That's where Lua Server Pages (LSP) comes in a rapid development framework designed to streamline web application development.
With LSP, you gain significant advantages:
If you're considering building your project purely in C, it's worth exploring the efficiency and flexibility of combining C with a high-level scripting language like Lua. This approach makes development faster, more maintainable, and safer, particularly for modern web-based device management applications .
Refer to our online CSP documentation for a detailed introduction to C Server Pages.