mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Use proper base url by default instead of hardcoded app_dev controller
This commit is contained in:
parent
b50f3ca185
commit
abac2a03df
@ -38,7 +38,7 @@ class Configuration implements ConfigurationInterface
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->scalarNode('enabled')->defaultTrue()->end()
|
||||
->scalarNode('endpoint')->defaultValue('/app_dev.php')->end()
|
||||
->scalarNode('endpoint')->defaultNull()->end()
|
||||
->arrayNode('request_format')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
|
@ -13,5 +13,5 @@
|
||||
<argument type="service" id="nelmio_api_doc.doc_comment_extractor" />
|
||||
<tag name="nelmio_api_doc.extractor.parser" />
|
||||
</service>
|
||||
</services>
|
||||
</services>
|
||||
</container>
|
||||
|
@ -195,6 +195,10 @@
|
||||
url += api_key_parameter + '=' + $('#api_key').val();
|
||||
}
|
||||
|
||||
{% if endpoint == '' and app.request is defined and app.request.host -%}
|
||||
{% set endpoint = app.request.getBaseUrl() -%}
|
||||
{% endif -%}
|
||||
|
||||
// and trigger the API call
|
||||
$.ajax({
|
||||
url: '{{ endpoint }}' + url,
|
||||
|
Loading…
x
Reference in New Issue
Block a user