mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-30 11:02:58 +08:00
Use bound URL in doc examples (closes #478)
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
> Example request:
|
||||
|
||||
```bash
|
||||
curl -X {{$route['methods'][0]}} {{$route['methods'][0] == 'GET' ? '-G ' : ''}}"{{ trim(config('app.docs_url') ?: config('app.url'), '/')}}/{{ ltrim($route['uri'], '/') }}" @if(count($route['headers']))\
|
||||
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']))\
|
||||
@foreach($route['headers'] as $header => $value)
|
||||
-H "{{$header}}: {{$value}}"@if(! ($loop->last) || ($loop->last && count($route['bodyParameters']))) \
|
||||
@endif
|
||||
@@ -25,7 +25,7 @@ curl -X {{$route['methods'][0]}} {{$route['methods'][0] == 'GET' ? '-G ' : ''}}"
|
||||
```
|
||||
|
||||
```javascript
|
||||
const url = new URL("{{ rtrim(config('app.docs_url') ?: config('app.url'), '/') }}/{{ ltrim($route['uri'], '/') }}");
|
||||
const url = new URL("{{ rtrim(config('app.docs_url') ?: config('app.url'), '/') }}/{{ ltrim($route['boundUri'], '/') }}");
|
||||
@if(count($route['queryParameters']))
|
||||
|
||||
let params = {
|
||||
|
||||
Reference in New Issue
Block a user