webserv/www/examples/sample.html
2025-10-01 18:03:00 +02:00

188 lines
5.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebServ Sample Page</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #333;
min-height: 100vh;
}
.container {
max-width: 800px;
margin: 0 auto;
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
h1 {
color: #2c3e50;
text-align: center;
margin-bottom: 30px;
}
.feature {
background: #f8f9fa;
padding: 15px;
margin: 15px 0;
border-left: 4px solid #007bff;
border-radius: 5px;
}
.code {
background: #2d3748;
color: #e2e8f0;
padding: 15px;
border-radius: 5px;
font-family: 'Courier New', monospace;
margin: 15px 0;
overflow-x: auto;
}
.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin: 20px 0;
}
.stat {
background: #e3f2fd;
padding: 15px;
border-radius: 5px;
text-align: center;
}
.stat-number {
font-size: 2em;
font-weight: bold;
color: #1976d2;
}
.footer {
text-align: center;
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #eee;
color: #666;
}
</style>
</head>
<body>
<div class="container">
<h1>🚀 WebServ Sample Page</h1>
<p>Welcome to the WebServ demonstration page! This HTML file showcases the static file serving capabilities of our high-performance C++ web server.</p>
<div class="feature">
<h3>✨ Key Features</h3>
<ul>
<li>HTTP/1.1 compliant implementation</li>
<li>Epoll-based event handling for maximum performance</li>
<li>Modern C++20 codebase</li>
<li>Nginx-style configuration</li>
<li>Virtual host support</li>
<li>Custom error pages</li>
</ul>
</div>
<div class="feature">
<h3>🔧 Technical Specifications</h3>
<p>Built with cutting-edge technology for optimal performance:</p>
<div class="code">
Compiler: clang++ 12.0.1
Standard: C++20
Architecture: x86_64
Build System: CMake + Make
Event Loop: epoll (Linux)
Memory Management: RAII + Smart Pointers
</div>
</div>
<div class="stats">
<div class="stat">
<div class="stat-number">10,000+</div>
<div>Concurrent Connections</div>
</div>
<div class="stat">
<div class="stat-number">&lt;1ms</div>
<div>Average Response Time</div>
</div>
<div class="stat">
<div class="stat-number">99.9%</div>
<div>Uptime Reliability</div>
</div>
<div class="stat">
<div class="stat-number">C++20</div>
<div>Modern Standard</div>
</div>
</div>
<div class="feature">
<h3>📊 Request Information</h3>
<p>This page was served by WebServ with the following details:</p>
<div class="code" id="request-info">
Server: WebServ/1.0
Content-Type: text/html; charset=UTF-8
Status: 200 OK
Method: GET
URI: /examples/sample.html
Timestamp: <span id="timestamp"></span>
</div>
</div>
<div class="feature">
<h3>🧪 Testing Commands</h3>
<p>You can test this page using various HTTP clients:</p>
<div class="code">
# Basic request
curl http://localhost:8080/examples/sample.html
# With headers
curl -I http://localhost:8080/examples/sample.html
# Performance test
ab -n 1000 -c 10 http://localhost:8080/examples/sample.html
</div>
</div>
<div class="footer">
<p><strong>WebServ</strong> - A high-performance C++20 web server</p>
<p>Part of the 42 School curriculum • Built with ❤️ and modern C++</p>
<p>Page generated at: <span id="page-time"></span></p>
</div>
</div>
<script>
// Add timestamp information
const now = new Date();
document.getElementById('timestamp').textContent = now.toISOString();
document.getElementById('page-time').textContent = now.toLocaleString();
// Add some interactivity
const stats = document.querySelectorAll('.stat-number');
stats.forEach(stat => {
stat.addEventListener('click', function() {
this.style.transform = 'scale(1.1)';
this.style.transition = 'transform 0.2s';
setTimeout(() => {
this.style.transform = 'scale(1)';
}, 200);
});
});
// Log page load information
console.log('WebServ Sample Page Loaded', {
url: window.location.href,
timestamp: now.toISOString(),
userAgent: navigator.userAgent,
viewport: {
width: window.innerWidth,
height: window.innerHeight
}
});
</script>
</body>
</html>