Skip to content

Support base url #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The following parameters can be set in config files or in env variables:

- LOG_LEVEL: the log level
- PORT: the server port
- API_VERSION: The API version
- SUBMISSION_API_URL: Submission API URL

- SONARQUBE_HOST: SonarQube host. Default: http://localhost:9000
Expand Down
2 changes: 2 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module.exports = {
LOG_LEVEL: process.env.LOG_LEVEL || 'debug',
PORT: process.env.PORT || 3000,

API_VERSION: process.env.API_VERSION || '/v5/qualityChecks',

SUBMISSION_API_URL: process.env.SUBMISSION_API_URL || 'https://api.topcoder-dev.com/v5',

SONARQUBE_HOST: process.env.SONARQUBE_HOST || 'http://localhost:9000',
Expand Down
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _.each(routes, (verbs, url) => {
next()
})
actions.push(method)
apiRouter[verb](url, helper.autoWrapExpress(actions))
apiRouter[verb](`${config.API_VERSION}${url}`, helper.autoWrapExpress(actions))
})
})

Expand Down