<commit_before><?php

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', ['middleware' => 'cors'], function ($api)
{
    $api->post('auth', 'App\Http\Controllers\AuthController@login');
    $api->get('auth', 'App\Http\Controllers\AuthController@verify');
    $api->delete('auth', 'App\Http\Controllers\AuthController@destroy');
    
    $api->resource('users', 'App\Http\Controllers\UsersController');
});

$app->get('{slug:.*}', function () use ($app)
{
    $envVars = json_encode([
        'API_STANDARDS_TREE' => env('API_STANDARDS_TREE'),
        'API_SUBTYPE'        => env('API_SUBTYPE'),
        'API_VERSION'        => env('API_VERSION')
    ]);

    return view('index', compact('envVars'));
});<commit_msg>Pass APP_ENV to client<commit_after><?php

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', ['middleware' => 'cors'], function ($api) {
    // Authentication routes
    $api->post('auth', 'App\Http\Controllers\AuthController@login');
    $api->get('auth', 'App\Http\Controllers\AuthController@verify');
    $api->delete('auth', 'App\Http\Controllers\AuthController@destroy');

    $api->resource('users', 'App\Http\Controllers\UsersController');
});

$app->get('{slug:.*}', function () use ($app) {
    // Careful not to pass secret keys to client here.
    $envVars = json_encode([
        'APP_ENV'            => env('APP_ENV'),
        'API_STANDARDS_TREE' => env('API_STANDARDS_TREE'),
        'API_SUBTYPE'        => env('API_SUBTYPE'),
        'API_VERSION'        => env('API_VERSION')
    ]);

    return view('index', compact('envVars'));
});
{'fraction_non_alphanumeric': 0.21145374449339208, 'fraction_numerical': 0.0012586532410320957, 'mean_word_length': 3.8773006134969323, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '2313878', 'n_tokens_mistral': 527, 'n_tokens_neox': 542, 'n_words': 78}