Skip to content

Commit

Permalink
Fix swagger endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nicdex committed Jun 1, 2018
1 parent 81cef6d commit 230cb13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jspm_packages
# Optional npm cache directory
.npm
yarn.lock
package-lock.json
.yarnclean

# Optional REPL history
Expand Down
3 changes: 3 additions & 0 deletions src/infra/initWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import glob from "glob";
import {newInject} from "./utils";
import {registerSecureRoutes, registerNonSecureRoutes} from "./staticRoutes";
import ReadModelGenericController from "./ReadModelGenericController";
import swaggerUi from "swagger-ui-express";
import swaggerDocument from "../../swagger.json";

export function loadControllersFactories(logger) {
return glob.sync(path.resolve(__dirname, '../controllers/**/*.js'))
Expand Down Expand Up @@ -44,6 +46,7 @@ export async function initWeb(services, controllerFactories) {
app.use(morgan(httpConfig.accessLogFormat || 'common'));
app.use(cors({origin: true, credentials: true}));
app.use(jsonParser());
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));

services.app = app;

Expand Down

0 comments on commit 230cb13

Please sign in to comment.