mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-29 18:46:25 +08:00
Switch to apidoc.base_url
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user