Skip to content

Commit

Permalink
fixed merge conflict - delete index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Zdrazil committed Jul 15, 2015
2 parents a254d72 + f18931d commit 24ae295
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 328 deletions.
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ module.exports = function (config) {
path = '/' + path;
}

console.log('Request: %s %s', req.method, path);
var matchingRoute = router.match('/' + method + path);

if (!matchingRoute) return next();

if (process.env.debug) {
console.log('Request: %s %s', req.method, path);
}

try {
var response = matchingRoute.fn();
res.setHeader('Content-Type', 'application/json');
Expand Down
324 changes: 0 additions & 324 deletions index.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swagger-mock-api",
"version": "1.4.0",
"version": "1.4.1",
"description": "Creates a connect middleware mock API from a Swagger 2.0 YAML file",
"main": "dist/index.js",
"repository": {
Expand Down
5 changes: 4 additions & 1 deletion src/ConfigureRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ export default function ConfigureRouter(paths) {
if (!path.hasOwnProperty(mk)) continue;

let method = path[mk];
console.log('ADDING ROUTE: ', mk.toUpperCase() + ' ' + pk);

if (process.env.debug) {
console.log('ADDING ROUTE: ', mk.toUpperCase() + ' ' + pk);
}

let respond = generateResponse(method.responses, pk);
router.addRoute('/' + mk + route, respond);
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ module.exports = function(config) {
path = '/' + path;
}

console.log('Request: %s %s', req.method, path);
const matchingRoute = router.match('/' + method + path);

if (!matchingRoute) return next();

if (process.env.debug) {
console.log('Request: %s %s', req.method, path);
}

try {
const response = matchingRoute.fn();
res.setHeader('Content-Type', 'application/json');
Expand Down

0 comments on commit 24ae295

Please sign in to comment.