File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " node-red-node-swagger" ,
3- "version" : " 0.1.5 " ,
3+ "version" : " 0.1.6 " ,
44 "description" : " A set of tools for generating Swagger API documentation based on the HTTP nodes deployed in a flow" ,
55 "license" : " Apache" ,
66 "repository" : {
22222323 ],
2424 "dependencies" : {
25- "swagger-ui" : " 2.1.3 " ,
25+ "swagger-ui" : " 2.1.4 " ,
2626 "i18next-client" : " 1.10.3"
2727 }
2828}
Original file line number Diff line number Diff line change 11/**
2- * Copyright 2015 IBM Corp.
2+ * Copyright 2015, 2016 IBM Corp.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -162,11 +162,15 @@ module.exports = function(RED) {
162162 }
163163
164164 RED . httpAdmin . get ( '/swagger-ui/reqs/i18next.min.js' , function ( req , res ) {
165- var filename = path . join ( __dirname , '../node_modules/i18next-client/i18next.min.js' ) ;
165+ var basePath = require . resolve ( 'i18next-client' ) ;
166+ basePath = basePath . replace ( / \/ i 1 8 n e x t .j s $ / , "" ) ;
167+ var filename = path . join ( basePath , 'i18next.min.js' ) ;
166168 sendFile ( res , filename ) ;
167169 } ) ;
168170 RED . httpAdmin . get ( '/swagger-ui/reqs/*' , function ( req , res ) {
169- var filename = path . join ( __dirname , '../node_modules/swagger-ui/dist' , req . params [ 0 ] ) ;
171+ var basePath = require . resolve ( 'swagger-ui' ) ;
172+ basePath = basePath . replace ( / \/ s w a g g e r - u i .j s $ / , "" ) ;
173+ var filename = path . join ( basePath , req . params [ 0 ] ) ;
170174 sendFile ( res , filename ) ;
171175 } ) ;
172176 RED . httpAdmin . get ( '/swagger-ui/nls/*' , function ( req , res ) {
You can’t perform that action at this time.
0 commit comments