#!/usr/bin/env python3
"""
Simple HTTP server to test the homepage functionality
"""
import http.server
import socketserver
import os
import webbrowser

# Set the port
PORT = 8080

# Change to the directory containing the test file
os.chdir('d:/bookbeach')

# Create the server
Handler = http.server.SimpleHTTPRequestHandler

try:
    with socketserver.TCPServer(("", PORT), Handler) as httpd:
        print(f"Server running at http://localhost:{PORT}/")
        print(f"Test homepage: http://localhost:{PORT}/test_homepage.html")
        print("Press Ctrl+C to stop the server")
        httpd.serve_forever()
except KeyboardInterrupt:
    print("\nServer stopped.")