mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 13:30:33 +03:00
chore: add simple parameter to playground to simplify local testing
This commit is contained in:
parent
851b1337cb
commit
5af6ba7191
|
@ -17,9 +17,12 @@ const renderRoot = (props: RedocProps) =>
|
||||||
);
|
);
|
||||||
|
|
||||||
const big = window.location.search.indexOf('big') > -1;
|
const big = window.location.search.indexOf('big') > -1;
|
||||||
const swagger = window.location.search.indexOf('swagger') > -1; // compatibility mode ?
|
const swagger = window.location.search.indexOf('swagger') > -1;
|
||||||
|
|
||||||
const specUrl = swagger ? 'swagger.yaml' : big ? 'big-openapi.json' : 'openapi.yaml';
|
const userUrl = window.location.search.match(/url=(.*)$/);
|
||||||
|
|
||||||
|
const specUrl =
|
||||||
|
(userUrl && userUrl[1]) || (swagger ? 'swagger.yaml' : big ? 'big-openapi.json' : 'openapi.yaml');
|
||||||
|
|
||||||
let store;
|
let store;
|
||||||
const options: RedocRawOptions = { nativeScrollbars: false };
|
const options: RedocRawOptions = { nativeScrollbars: false };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user