mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
disable cors for dev demopage
This commit is contained in:
parent
86c0dcbfe1
commit
892d4f0082
|
@ -24,6 +24,9 @@
|
||||||
|
|
||||||
<redoc scroll-y-offset="body > nav" spec-url='swagger.yaml' lazy-rendering></redoc>
|
<redoc scroll-y-offset="body > nav" spec-url='swagger.yaml' lazy-rendering></redoc>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.__REDOC_DEV__ = true;
|
||||||
|
</script>
|
||||||
<script src="main.js"> </script>
|
<script src="main.js"> </script>
|
||||||
<script src="/webpack-dev-server.js"></script>
|
<script src="/webpack-dev-server.js"></script>
|
||||||
<script src="/polyfills.js"></script>
|
<script src="/polyfills.js"></script>
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
var url = window.location.search.match(/url=([^&]+)/);
|
var url = window.location.search.match(/url=([^&]+)/);
|
||||||
if (url && url.length > 1) {
|
if (url && url.length > 1) {
|
||||||
url = decodeURIComponent(url[1]);
|
url = decodeURIComponent(url[1]);
|
||||||
document.getElementsByTagName('redoc')[0].setAttribute('spec-url', '\\\\cors.apis.guru/' + url);
|
url = window.__REDOC_DEV__ ? url : '\\\\cors.apis.guru/' + url;
|
||||||
|
document.getElementsByTagName('redoc')[0].setAttribute('spec-url', url);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateQueryStringParameter(uri, key, value) {
|
function updateQueryStringParameter(uri, key, value) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user