def METHOD_NAME(self):
    print("path: ", self.path)
    if self.path == '/':
        link = "data"
        try:
            message_parts = [
                'account_id: %s' % ec2_metadata.account_id,
                'ami_id: %s' % ec2_metadata.ami_id,
                'availability_zone: %s' % ec2_metadata.availability_zone,
                'instance_id: %s' % ec2_metadata.instance_id,
                'instance_type: %s' % ec2_metadata.instance_type,
                'private_hostname: %s' % ec2_metadata.private_hostname,
                'private_ipv4: %s' % ec2_metadata.private_ipv4
            ]
            message = '<br>'.join(message_parts)
        except Exception:
            message = "Running outside AWS"
        # Write data into the Database
        self.cursor = self.db.cursor()
        sql = "INSERT INTO hits(ip) VALUES ('{IPAddress}')".format(IPAddress=self.client_address[0])
        self.cursor.execute(sql)
        self.db.commit()
        # Send response status code
        self.send_response(200)
        # Send headers
        self.send_header('Content-type', 'text/html')
        self.end_headers()
        self.wfile.write(
            bytes(
                html.format(Content=message, WebSiteImage=self.url_image, Message="Data from the metadata API", Link=link),
                "utf-8"
            )
        )
    elif self.path == '/data':
        link = ".."
        self.cursor = self.db.cursor()
        sql = "SELECT * from hits order by time desc limit 10"
        self.cursor.execute(sql)
        results = self.cursor.fetchall()
        message = []
        for row in results:
            ip = row[0]
            time = row[1]
            message.append("ip = %s   time = %s" % (ip, time))
        msg = '<br>'.join(message)
        self.send_response(200)
        # Send headers
        self.send_header('Content-type', 'text/html')
        self.end_headers()
        self.wfile.write(
            bytes(
                html.format(Content=msg, WebSiteImage="", Message="Data from the Database", Link=link),
                "utf-8"
            )
        )
    return