Skip to content

Commit

Permalink
save 8
Browse files Browse the repository at this point in the history
  • Loading branch information
GochoMugo committed Dec 3, 2016
1 parent 93e4658 commit da12212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/



// built-in modules
const fs = require('fs');
const path = require('path');
Expand Down Expand Up @@ -38,15 +37,15 @@ exports.router = router;
exports.utils = utils;


// Redirect to the latest API docs
// Redirecting to the latest API docs
router.get('/api', function(req, res) {
return res.redirect(`${req.baseUrl}/api/v${apiVersion}`);
});


// Rendering the API docs
router.get('/api/:version', function(req, res, next) {
const match = /^v(\d)$/.exec(req.params.version);
const match = /^v(\d+)$/.exec(req.params.version);
if (!match) return next();

if (!apis[match[1]]) {
Expand Down
2 changes: 1 addition & 1 deletion test/test.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const app = require('../app');
// module variables
const schemaDir = path.resolve(__dirname, '../schema');
const staticServer = express();
const staticServerPort = 9667;
const appPort = 9666;
const staticServerPort = 9667;


before(function(done) {
Expand Down

0 comments on commit da12212

Please sign in to comment.