-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29793dc
commit 58cecb3
Showing
7 changed files
with
65 additions
and
12 deletions.
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
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
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,44 @@ | ||
import express, { Router } from 'express'; | ||
import authRoute from './Auth/auth.route.v1'; | ||
import docsRoute from './swagger/swagger.route'; | ||
import userRoute from './Users/user.route.v1'; | ||
import config from './config/config'; | ||
|
||
const router = express.Router(); | ||
|
||
interface IRoute { | ||
path: string; | ||
route: Router; | ||
} | ||
|
||
const defaultIRoute: IRoute[] = [ | ||
{ | ||
path: '/auth', | ||
route: authRoute, | ||
}, | ||
{ | ||
path: '/users', | ||
route: userRoute, | ||
}, | ||
]; | ||
|
||
const devIRoute: IRoute[] = [ | ||
// IRoute available only in development mode | ||
{ | ||
path: '/docs', | ||
route: docsRoute, | ||
}, | ||
]; | ||
|
||
defaultIRoute.forEach((route) => { | ||
router.use(route.path, route.route); | ||
}); | ||
|
||
/* istanbul ignore next */ | ||
if (config.env === 'development') { | ||
devIRoute.forEach((route) => { | ||
router.use(route.path, route.route); | ||
}); | ||
} | ||
|
||
export default router; |
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