From 7d972dfb2fe12800ffb6deef9c75a172f2ad019c Mon Sep 17 00:00:00 2001 From: Tamas Date: Sun, 7 May 2017 14:01:22 +0200 Subject: [PATCH] Update swagger-editor to support definitions with external references Serve files from the swagger yaml's directory, so they can be included. --- lib/commands/project/swagger_editor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/commands/project/swagger_editor.js b/lib/commands/project/swagger_editor.js index d03247de..788a23a3 100644 --- a/lib/commands/project/swagger_editor.js +++ b/lib/commands/project/swagger_editor.js @@ -65,8 +65,10 @@ function edit(project, options, cb) { // serve swagger-editor app.use(SWAGGER_EDITOR_SERVE_PATH, serveStatic(config.swagger.editorDir)); - - + + // Serve the references of the definition file + app.use("/", serveStatic(path.dirname(swaggerFile))); + // start // var http = require('http');