#!/usr/bin/env python3 """ Basic HTTP server to serve the tablet management system """ from http.server import SimpleHTTPRequestHandler, HTTPServer import os class MyHandler(SimpleHTTPRequestHandler): def do_GET(self): if self.path == '/': self.path = '/index.html' return super().do_GET() def run_server(): port = 8080 server_address = ('', port) httpd = HTTPServer(server_address, MyHandler) # Create a simple index file if it doesn't exist if not os.path.exists('index.html'): with open('index.html', 'w') as f: f.write(''' Tablet Management System

Tablet Management System

Welcome to the Tablet Management System!

This system is running with a SQLite backend.

Available Commands:

Current Status:

✓ Database: tablets.db

✓ Web server: Running on port 8080

✓ System: Ready for use

Quick Test Results:

Running tests...
''') print(f"Server running on http://localhost:{port}") print("Serving current directory") print("Press Ctrl+C to stop the server") try: httpd.serve_forever() except KeyboardInterrupt: print("\nServer stopped") if __name__ == '__main__': run_server()