Skip to content

Commit

Permalink
Handle windows paths when serving resources
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed Jul 5, 2016
1 parent 3bba52c commit 31b304f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-node-swagger",
"version": "0.1.6",
"version": "0.1.7",
"description": "A set of tools for generating Swagger API documentation based on the HTTP nodes deployed in a flow",
"license": "Apache",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions swagger/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ module.exports = function(RED) {

RED.httpAdmin.get('/swagger-ui/reqs/i18next.min.js', function(req, res){
var basePath = require.resolve('i18next-client');
basePath = basePath.replace(/\/i18next.js$/,"");
basePath = basePath.replace(/[\\\/]i18next.js$/,"");
var filename = path.join(basePath,'i18next.min.js');
sendFile(res,filename);
});
RED.httpAdmin.get('/swagger-ui/reqs/*', function(req, res){
var basePath = require.resolve('swagger-ui');
basePath = basePath.replace(/\/swagger-ui.js$/,"");
basePath = basePath.replace(/[\\\/]swagger-ui.js$/,"");
var filename = path.join(basePath, req.params[0]);
sendFile(res,filename);
});
Expand Down

0 comments on commit 31b304f

Please sign in to comment.