Browse Source

Merge pull request #555 from pelias/redirect_to_v1

Redirect to /v1 if no legacy proxy specified
pull/557/head
Julian Simioni 9 years ago
parent
commit
38cabe5a2f
  1. 4
      routes/legacy.js

4
routes/legacy.js

@ -4,8 +4,8 @@ function addRoutes(app, peliasConfig) {
var sendToLegacy;
if (!peliasConfig.hasOwnProperty('legacyUrl')) {
sendToLegacy = function doNothing(req, res, next) {
next(new Error('Invalid path, no legacy proxy specified'));
sendToLegacy = function redirectToV1(req, res, next) {
res.redirect(301, '/v1');
};
}
else {

Loading…
Cancel
Save