Skip to content

Commit 31b304f

Browse files
committed
Handle windows paths when serving resources
1 parent 3bba52c commit 31b304f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-node-swagger",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
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": {

swagger/swagger.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ module.exports = function(RED) {
163163

164164
RED.httpAdmin.get('/swagger-ui/reqs/i18next.min.js', function(req, res){
165165
var basePath = require.resolve('i18next-client');
166-
basePath = basePath.replace(/\/i18next.js$/,"");
166+
basePath = basePath.replace(/[\\\/]i18next.js$/,"");
167167
var filename = path.join(basePath,'i18next.min.js');
168168
sendFile(res,filename);
169169
});
170170
RED.httpAdmin.get('/swagger-ui/reqs/*', function(req, res){
171171
var basePath = require.resolve('swagger-ui');
172-
basePath = basePath.replace(/\/swagger-ui.js$/,"");
172+
basePath = basePath.replace(/[\\\/]swagger-ui.js$/,"");
173173
var filename = path.join(basePath, req.params[0]);
174174
sendFile(res,filename);
175175
});

0 commit comments

Comments
 (0)