Skip to content
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

Open
wants to merge 109 commits into
base: master
Choose a base branch
from

Conversation

nxanil
Copy link
Collaborator

@nxanil nxanil commented May 8, 2017

@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.

Copy link
Contributor

@curran curran left a 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.

@nxanil nxanil mentioned this pull request May 30, 2017
var client = null;
let config = function () {
return {
host: process.env.APP_ELASTICSEARCH_HOST ? process.env.APP_ELASTICSEARCH_HOST : null,
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, added it!

@@ -4,11 +4,12 @@ import { checkStatus, parseJSON } from "../common";

const config = {
path: process.env.PUBLIC_URL + "/configurations/",
api: process.env.REACT_APP_API_URL,
Copy link
Contributor

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

Copy link
Collaborator Author

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',
Copy link
Contributor

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 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@nxanil
Copy link
Collaborator Author

nxanil commented Jul 31, 2017

@ronakmshah

As per our discussion:
We are moving the constants like "REACT_MIDDLEWARE_URL" to CDN based JSON file and will read it from there and put the path of it in .env.

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.

nxanil and others added 28 commits January 5, 2018 20:41
@nxanil nxanil force-pushed the feature/middleware-setup branch from 4336144 to 296069c Compare February 12, 2018 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants