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

Separate configuration from build artifact #21

Open
4 tasks
prince-chrismc opened this issue Oct 9, 2020 · 6 comments
Open
4 tasks

Separate configuration from build artifact #21

prince-chrismc opened this issue Oct 9, 2020 · 6 comments
Labels
back-end This issue or pull request pertains to the back-end component deployment This issue or pull request pertains to the means by which the application is published front-end This issue or pull request pertains to the front-end component

Comments

@prince-chrismc
Copy link
Owner

prince-chrismc commented Oct 9, 2020

Front-end

  • create separate config.js that exports a config object
  • hook to verify only config.js accesses environment variables

Update: Neither of the options listed were supported via WebPack

Back-end

  • Add configuration for CORS headers (possibly command line interface)
  • look into steamline configuration file like toml
@prince-chrismc prince-chrismc added the enhancement Issue that adds a new feature label Oct 9, 2020
@prince-chrismc prince-chrismc added this to the 1.0.0-dev.1 milestone Oct 9, 2020
@prince-chrismc prince-chrismc added back-end This issue or pull request pertains to the back-end component front-end This issue or pull request pertains to the front-end component labels Oct 16, 2020
@prince-chrismc prince-chrismc added the deployment This issue or pull request pertains to the means by which the application is published label Dec 11, 2020
@prince-chrismc
Copy link
Owner Author

https://www.pluralsight.com/guides/how-to-store-and-read-configuration-files-using-react

Doing more research there seems to be a lot more options out there.

prince-chrismc added a commit that referenced this issue Dec 13, 2020
towards #21 but seems to be a particale challenge using webpack
@prince-chrismc
Copy link
Owner Author

This really appears to be a technical limitation with the original design of the project.

Using webpack allowed for the static output to be hosted via the C++ backend but that "static" requires the building the artifact with the configuration 🤔

@prince-chrismc
Copy link
Owner Author

In order to achieve this goal its possible use a hybrid solution where the frontend is hosted by a node.js server like express or https://github.com/fastify/fastify which looks very promising.

Still more research to see how this can be over come

@prince-chrismc
Copy link
Owner Author

static pre-rendered data, which is the fastest browsing seems to really be limited on this front prince-chrismc/Hello-Next@8dce160

As soon as any packing takes place, it needs to be built into the artifact! very frustrating topic!

@prince-chrismc prince-chrismc removed the enhancement Issue that adds a new feature label Jan 29, 2021
@prince-chrismc
Copy link
Owner Author

This has dropped in priority since the front-end needs to be built with the correct FQDN for technical reasons and the back-end will be deployed in HTTP. There is no configuration which can no be set from the docker images

@prince-chrismc prince-chrismc removed this from the 1.0.0-dev.2 milestone Feb 7, 2021
@prince-chrismc
Copy link
Owner Author

A possibility here is to have a configuration file, not a part of the web application, but the micro service hosted/exposed by the web server.

  1. Build front-end
  2. Build back-end
  3. startup script writes configuration.json from environment variables
  4. web app GETs /configuration.json
  5. read config's "back-end URL"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end This issue or pull request pertains to the back-end component deployment This issue or pull request pertains to the means by which the application is published front-end This issue or pull request pertains to the front-end component
Projects
None yet
Development

No branches or pull requests

1 participant