forked from pelias/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Merge pull request pelias#962 from pelias/root_route
Add default route redirecting to /v1
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |