added null check

This commit is contained in:
Tony Tam
2014-09-20 21:20:15 -07:00
parent 8258d8b4d9
commit fedb12960b

8
dist/index.html vendored
View File

@@ -25,8 +25,14 @@
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
var url = window.location.search.match(/url=([^&]+)/);
if (url && url.length > 1) {
url = url[1];
} else {
url = "http://petstore.swagger.wordnik.com/v2/swagger.json";
}
window.swaggerUi = new SwaggerUi({ window.swaggerUi = new SwaggerUi({
url: "http://petstore.swagger.wordnik.com/v2/swagger.json", url: url,
dom_id: "swagger-ui-container", dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete'], supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
onComplete: function(swaggerApi, swaggerUi){ onComplete: function(swaggerApi, swaggerUi){