-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feature/middleware setup - Basic Architecture and API to fetch Dashboard Configuration #367
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Looks good in terms of choices for dependencies and build.
var client = null; | ||
let config = function () { | ||
return { | ||
host: process.env.APP_ELASTICSEARCH_HOST ? process.env.APP_ELASTICSEARCH_HOST : null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currentConfig.host = state.ES.get(ActionKeyStore.ES_HOST) || process.env.REACT_APP_ELASTICSEARCH_HOST;
We are missing to parse the first param, arnt we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, added it!
src/services/configurations/index.js
Outdated
@@ -4,11 +4,12 @@ import { checkStatus, parseJSON } from "../common"; | |||
|
|||
const config = { | |||
path: process.env.PUBLIC_URL + "/configurations/", | |||
api: process.env.REACT_APP_API_URL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please have a config.js file where all the configs are assigned. Accessing process.env directly is not a good idea. Also, have a default value set for each one of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its fine to have process.env.REACT_APP_API_URL, as we build the app for production, then this will going to be replaced.
release: require('../../package.json').version, | ||
baseDir: path.normalize(__dirname + '/../..'), | ||
|
||
apiPrefix: '/api', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall this be made /reports/api ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
As per our discussion: Advantages of it is that whenever we need to update some config then we only have to update the config file instead of rebuilding the project. Please suggest. |
…iddleware-testing
…iddleware-testing
4336144
to
296069c
Compare
@ronakmshah @curran
Please review the setup of Express JS middleware and api to fetch default configurations.
Setup instruction are updated into Readme of root folder as well as server folder.