<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-


"""

    YAMA HTTP web server based in bottle framework

"""

from bottle import run, route

@route('/status')
def status():
   response = { "status": "ok" }
   return response

@route('/reload_config')
def reload_config():
    response = { "status": "config reloaded" }
    return response

def start(host, port):<commit_msg>Added URLINFO route in server module: parse URL properly and response it<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-


"""

    YAMA HTTP web server based in bottle framework

"""
from bottle import run, route, request

@route('/status')
def status():
   response = { "status": "ok" }
   return response

@route('/reload_config')
def reload_config():
    response = { "status": "config reloaded" }
    return response

@route('/urlinfo/1/<hostname>\:<port:int>/<path_query:re:.*>')
def urlinfo(hostname, port, path_query):
    # we have to split the full path request
    # in order to trim 'urlinfo/1/<hostname>:<port>
    path = str(request.fullpath).split(':',1)[1].split('/',1)[1]
    # The query does not have any character after '#'
    query = str(request.query_string)
    response = { "hostname": str(hostname), "port": port, "full_path": path+"?"+query }
    return response

def start(host, port):
{'fraction_non_alphanumeric': 0.16310975609756098, 'fraction_numerical': 0.006097560975609756, 'mean_word_length': 3.8992537313432836, 'pattern_counts': {'":': 7, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2304595', 'n_tokens_mistral': 418, 'n_tokens_neox': 412, 'n_words': 124}