<commit_before><?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->get('/', function () use ($app) {
    return $app->make('view')->make('index')->with(
        [ 'url' => isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? 'http://' . $_SERVER['HTTP_X_FORWARDED_HOST'] : url() ]
    );
});
//
// $app->get('/', function () use ($app) {
//     return $app->version();
// });

$app->get('api/status', 'Status@show');

$app->get('api/protocols/bgp', 'Protocols@bgp');
$app->get('api/protocol/{protocol}', 'Protocols@protocol');

$app->get('api/symbols', 'Symbols@all');
$app->get('api/symbols/tables', 'Symbols@tables');
$app->get('api/symbols/protocols', 'Symbols@protocols');

$app->get('api/routes/protocol/{protocol}', 'Routes@protocol');
$app->get('api/routes/table/{table}', 'Routes@table');

$app->get('api/routes/count/protocol/{protocol}', 'Routes@protocolCount');
$app->get('api/routes/count/table/{table}', 'Routes@tableCount');

//$app->group(['middleware' => 'auth'], function () use ($app) {
    $app->get('api/route/{net}', 'Routes@lookup');
    $app->get('api/route/{net}/table/{table}', 'Routes@lookup');
//});<commit_msg>Better resolution<commit_after><?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->get('/', function () use ($app) {

    $proto = isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] ? 'https://' : 'http://';
    $url = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $proto . $_SERVER['HTTP_X_FORWARDED_HOST'] : url();

    return $app->make('view')->make('index')->with( [ 'url' => $url ] );
});

$app->get('api/status', 'Status@show');

$app->get('api/protocols/bgp', 'Protocols@bgp');
$app->get('api/protocol/{protocol}', 'Protocols@protocol');

$app->get('api/symbols', 'Symbols@all');
$app->get('api/symbols/tables', 'Symbols@tables');
$app->get('api/symbols/protocols', 'Symbols@protocols');

$app->get('api/routes/protocol/{protocol}', 'Routes@protocol');
$app->get('api/routes/table/{table}', 'Routes@table');

$app->get('api/routes/count/protocol/{protocol}', 'Routes@protocolCount');
$app->get('api/routes/count/table/{table}', 'Routes@tableCount');

//$app->group(['middleware' => 'auth'], function () use ($app) {
    $app->get('api/route/{net}', 'Routes@lookup');
    $app->get('api/route/{net}/table/{table}', 'Routes@lookup');
//});
{'fraction_non_alphanumeric': 0.32284263959390863, 'fraction_numerical': 0.0, 'mean_word_length': 3.0382513661202184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 1, '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': '5902505', 'n_tokens_mistral': 926, 'n_tokens_neox': 941, 'n_words': 177}