diff --git a/lib/commands/project/swagger_editor.js b/lib/commands/project/swagger_editor.js index d03247de..0167fe80 100644 --- a/lib/commands/project/swagger_editor.js +++ b/lib/commands/project/swagger_editor.js @@ -44,6 +44,9 @@ function edit(project, options, cb) { var swaggerFile = path.resolve(project.dirname, config.swagger.fileName); var app = require('connect')(); + // serve swagger-editor + app.use(SWAGGER_EDITOR_SERVE_PATH, serveStatic(config.swagger.editorDir)); + // save the file from swagger-editor app.use(SWAGGER_EDITOR_SAVE_PATH, function(req, res, next) { if (req.method !== 'PUT') { return next(); } @@ -63,10 +66,6 @@ function edit(project, options, cb) { res.end(JSON.stringify(config.swagger.editorConfig)); }); - // serve swagger-editor - app.use(SWAGGER_EDITOR_SERVE_PATH, serveStatic(config.swagger.editorDir)); - - // start // var http = require('http'); diff --git a/package.json b/package.json index 45cc8b6b..2052bdf8 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "nodemon": "^1.3.7", "serve-static": "^1.9.2", "swagger-converter": "^0.2.0", - "swagger-editor": "^2.9.2", + "swagger-editor": "^2.9.8", "swagger-test-templates": "^1.2.0", "swagger-tools": "^0.9.0" },