Skip to content

Commit 5d13fcf

Browse files
Merge pull request #10 from topcoder-platform/Issue_9
Support base url
2 parents 228fc59 + 252aa71 commit 5d13fcf

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The following parameters can be set in config files or in env variables:
3434

3535
- LOG_LEVEL: the log level
3636
- PORT: the server port
37+
- API_VERSION: The API version
3738
- SUBMISSION_API_URL: Submission API URL
3839

3940
- SONARQUBE_HOST: SonarQube host. Default: http://localhost:9000

config/default.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ module.exports = {
66
LOG_LEVEL: process.env.LOG_LEVEL || 'debug',
77
PORT: process.env.PORT || 3000,
88

9+
API_VERSION: process.env.API_VERSION || '/v5/qualityChecks',
10+
911
SUBMISSION_API_URL: process.env.SUBMISSION_API_URL || 'https://api.topcoder-dev.com/v5',
1012

1113
SONARQUBE_HOST: process.env.SONARQUBE_HOST || 'http://localhost:9000',

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ _.each(routes, (verbs, url) => {
4848
next()
4949
})
5050
actions.push(method)
51-
apiRouter[verb](url, helper.autoWrapExpress(actions))
51+
apiRouter[verb](`${config.API_VERSION}${url}`, helper.autoWrapExpress(actions))
5252
})
5353
})
5454

0 commit comments

Comments
 (0)