Switch to apidoc.base_url

This commit is contained in:
shalvah
2019-06-08 12:27:36 +02:00
parent 3aa1becf03
commit ced78cf066
10 changed files with 35 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
```bash
curl -X {{$route['methods'][0]}} {{$route['methods'][0] == 'GET' ? '-G ' : ''}}"{{ trim(config('app.docs_url') ?: config('app.url'), '/')}}/{{ ltrim($route['boundUri'], '/') }}" @if(count($route['headers']))\
curl -X {{$route['methods'][0]}} {{$route['methods'][0] == 'GET' ? '-G ' : ''}}"{{ rtrim($baseUrl, '/')}}/{{ ltrim($route['boundUri'], '/') }}" @if(count($route['headers']))\
@foreach($route['headers'] as $header => $value)
-H "{{$header}}: {{$value}}"@if(! ($loop->last) || ($loop->last && count($route['bodyParameters']))) \
@endif

View File

@@ -1,5 +1,5 @@
```javascript
const url = new URL("{{ rtrim(config('app.docs_url') ?: config('app.url'), '/') }}/{{ ltrim($route['boundUri'], '/') }}");
const url = new URL("{{ rtrim($baseUrl, '/') }}/{{ ltrim($route['boundUri'], '/') }}");
@if(count($route['queryParameters']))
let params = {

View File

@@ -1,7 +1,7 @@
```php
$client = new \GuzzleHttp\Client();
$response = $client->{{ strtolower($route['methods'][0]) }}("{{ $route['boundUri'] }}", [
$response = $client->{{ strtolower($route['methods'][0]) }}("{{ rtrim($baseUrl, '/') . '/' . $route['boundUri'] }}", [
@if(!empty($route['headers']))
'headers' => [
@foreach($route['headers'] as $header => $value)