Skip to content

Commit 31f7b1e

Browse files
author
sachin-maheshwari
authored
Merge pull request #6 from topcoder-platform/feature/version-support
changing endpoints.
2 parents 5e25ace + e109734 commit 31f7b1e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

config/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = {
4141
//in every 2 minutes will retry for failed status
4242
EMAIL_RETRY_SCHEDULE: process.env.EMAIL_RETRY_SCHEDULE || '0 */2 * * * *',
4343

44-
API_CONTEXT_PATH: process.env.API_CONTEXT_PATH || '/email',
44+
API_CONTEXT_PATH: process.env.API_CONTEXT_PATH || 'email',
4545
API_VERSION: process.env.API_VERSION || 'v5',
4646

4747
};

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function start(handlers) {
190190
next();
191191
});
192192
if ((url !== '/email/health')
193-
&& (url !== `${config.API_CONTEXT_PATH}/${config.API_VERSION}/health`)) {
193+
&& (url !== `/${config.API_VERSION}/${config.API_CONTEXT_PATH}/health`)) {
194194
actions.push(jwtAuth());
195195
actions.push((req, res, next) => {
196196
if (!req.authUser) {

src/routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ routes[oldkeyHealthCheck] = {
2020
}
2121
};
2222

23-
const keyEventType = `${config.API_CONTEXT_PATH}/${config.API_VERSION}/templates/eventType/:name`;
23+
const keyEventType = `/${config.API_VERSION}/${config.API_CONTEXT_PATH}/templates/eventType/:name`;
2424
routes[keyEventType] = {
2525
get: {
2626
controller: 'TemplateController',
2727
method: 'eventTypes',
2828
}
2929
};
3030

31-
const keyHealthCheck = `${config.API_CONTEXT_PATH}/${config.API_VERSION}/health`;
31+
const keyHealthCheck = `/${config.API_VERSION}/${config.API_CONTEXT_PATH}/health`;
3232
routes[keyHealthCheck] = {
3333
get: {
3434
controller: 'HealthController',

0 commit comments

Comments
 (0)