Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

new swagger-editor version #344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/commands/project/swagger_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down