juanal98
5 years ago
committed by
GitHub
1 changed files with 25 additions and 0 deletions
@ -0,0 +1,25 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use App\Helpers\ProxyHelperFacade; |
||||
|
use Illuminate\Http\Request; |
||||
|
|
||||
|
/* |
||||
|
|-------------------------------------------------------------------------- |
||||
|
| API Routes |
||||
|
|-------------------------------------------------------------------------- |
||||
|
| |
||||
|
| Here is where you can register API routes for your application. These |
||||
|
| routes are loaded by the RouteServiceProvider within a group which |
||||
|
| is assigned the "api" middleware group. Enjoy building your API! |
||||
|
| |
||||
|
*/ |
||||
|
|
||||
|
Route::match(['get', 'post', 'head', 'patch', 'put', 'delete'] , 'proxy/{slug}', function(Request $request){ |
||||
|
|
||||
|
return ProxyHelperFacade::CreateProxy($request) |
||||
|
->withHeaders(['x-proxy' => 'laravel']) |
||||
|
->withToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6Imp1YW5AZ21haWwuY29tIiwic2oxNTkwMTkyNTE1fQ.db5AZuw3eSAHqjdaRn9AZX8LPbNAxPmuO8BZlEmIGk4') |
||||
|
->preserveQuery(true) |
||||
|
->toHost('http://dockerserver.test','api/proxy'); |
||||
|
|
||||
|
})->where('slug', '([A-Za-z0-9\-\/]+)'); |
Loading…
Reference in new issue