Skip to content

Commit

Permalink
Merge 1ab5450 into 805de92
Browse files Browse the repository at this point in the history
  • Loading branch information
Nziranziza committed Feb 7, 2019
2 parents 805de92 + 1ab5450 commit b4242af
Show file tree
Hide file tree
Showing 9 changed files with 901 additions and 374 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ shrinkwrap.yaml
# NPM and Yarn lock file

yarn.lock
package-lock.json

# Winston logger files

Expand Down
6 changes: 6 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import express from 'express';
import cors from 'cors';
import morgan from 'morgan';
import swaggerUI from 'swagger-ui-express';
import YAML from 'yamljs';
import methodOverride from 'method-override';
import { joiErrors } from './middlewares';
import routes from './routes';
Expand All @@ -9,6 +11,8 @@ const isProduction = process.env.NODE_ENV === 'production';

const app = express();

const swaggerYAMLDocs = YAML.load('./docs/swagger.yml');

app.use(cors());

app.use(morgan('dev'));
Expand All @@ -17,6 +21,8 @@ app.use(express.json());
app.use(methodOverride('_method'));
app.use(routes);
app.use(joiErrors());
app.use('/api-documentation', swaggerUI.serve, swaggerUI.setup(swaggerYAMLDocs));


// development error handler
if (!isProduction) {
Expand Down
Loading

0 comments on commit b4242af

Please sign in to comment.