chore: add simple parameter to playground to simplify local testing

This commit is contained in:
Roman Hotsiy 2019-03-28 10:39:41 +02:00
parent 851b1337cb
commit 5af6ba7191
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -17,9 +17,12 @@ const renderRoot = (props: RedocProps) =>
);
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;
const options: RedocRawOptions = { nativeScrollbars: false };