<commit_before><?php

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

Route::get('api/', function () {
    return view('welcome');
});

Route::resource('api/collections', 'CollectionsController');

Route::resource('api/documents', 'DocumentsController',
                ['only' => ['index', 'show']]);

Route::resource('api/documents.covers', 'CoversController');<commit_msg>Add CORS to /api routes<commit_after><?php

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

Route::group(['middleware' => 'cors'], function(){

    Route::get('api/', function () {
        return view('welcome');
    });

    Route::resource('api/collections', 'CollectionsController');

    Route::resource('api/documents', 'DocumentsController',
                    ['only' => ['index', 'show']]);

    Route::resource('api/documents.covers', 'CoversController');

});
{'fraction_non_alphanumeric': 0.3210768220617203, 'fraction_numerical': 0.0, 'mean_word_length': 1.8274582560296846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '5130905', 'n_tokens_mistral': 363, 'n_tokens_neox': 344, 'n_words': 112}