class Weban:
    def __init__(self):
        self.routes = {}

    def route(self, path):
        def wrapper(func):
            self.routes[path] = func
            return func
        return wrapper

    def run(self, host='127.0.0.1', port=5000):
        from http.server import BaseHTTPRequestHandler, HTTPServer
        import urllib.parse

        class RequestHandler(BaseHTTPRequestHandler):
            def do_GET(self):
                parsed_path = urllib.parse.urlparse(self.path)
                handler = self.server.app.routes.get(parsed_path.path)
                if handler:
                    response = handler()
                    self.send_response(200)
                    self.send_header('Content-type', 'text/html')
                    self.end_headers()
                    self.wfile.write(response.encode())
                else:
                    self.send_response(404)
                    self.end_headers()

        server = HTTPServer((host, port), RequestHandler)
        server.app = self
        print(f'Serving on http://{host}:{port}')
        print(f'It is running...')
        server.serve_forever()

