mirror of https://github.com/pelias/api.git
Browse Source
This makes the root URL of the API a bit more friendly Fixes https://github.com/pelias/api/issues/961pull/962/head
Julian Simioni
7 years ago
2 changed files with 16 additions and 1 deletions
@ -0,0 +1,12 @@
|
||||
// set up routes that are outside any particular API version
|
||||
function addRoutes(app) { |
||||
function redirectToV1(req, res, next) { |
||||
res.redirect(301, '/v1'); |
||||
} |
||||
|
||||
// default root URL traffic to V1 root
|
||||
// which has a link to the readme and other helpful info
|
||||
app.get('/', redirectToV1); |
||||
} |
||||
|
||||
module.exports.addRoutes = addRoutes; |
Loading…
Reference in new issue