Skip to content

Commit

Permalink
Merge pull request #42 from ibrokethat/master
Browse files Browse the repository at this point in the history
Serves swagger spec file from the microservice.server.name path
  • Loading branch information
ph0bos authored Mar 6, 2018
2 parents 65bc5f7 + 4d48aa8 commit 633c5aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/swagger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var fs = require('fs');
var yaml = require('js-yaml');
var path = require('path');
var swagger = require('swagger-tools');
var config = require('konfig')({path: 'config'});

var log = require('../logger');
var requestErrorHandler = require('./requestErrorHandler');
Expand Down Expand Up @@ -46,8 +47,8 @@ module.exports = function initSwagger (app, options) {
app.use(responseErrorHandler);

// Serve the Swagger documents and Swagger UI
app.use(middleware.swaggerUi());

app.use(`/${config.app.microservice.server.name}`, middleware.swaggerUi());
app.emit('swagger:routes:registered');
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "express-microservice-starter",
"version": "0.6.7",
"version": "0.6.8",
"description": "An express-based Node.js API bootstrapping module for microservices.",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 633c5aa

Please sign in to comment.