forked from dreamfactorysoftware/df-file
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.php
24 lines (21 loc) · 788 Bytes
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
/*
|--------------------------------------------------------------------------
| Storage Services Routes
|--------------------------------------------------------------------------
|
| These routes give URL access to folders declared public in your file
| service's configuration.
|
*/
Route::prefix(config('df.storage_route_prefix'))
->middleware('df.cors')
->group(function () {
$resourcePathPattern = '[0-9a-zA-Z-_@&\#\!=,:;\/\^\$\.\|\{\}\[\]\(\)\*\+\? ]+';
$servicePattern = '[_0-9a-zA-Z-.]+';
$controller = 'DreamFactory\Core\File\Http\Controllers\StorageController';
Route::get('{storage}/{path}', $controller . '@streamFile')->where(
['storage' => $servicePattern, 'path' => $resourcePathPattern]
);
}
);