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

Configurable routing #501

Open
dvmarkusvogl opened this issue Feb 16, 2022 · 4 comments
Open

Configurable routing #501

dvmarkusvogl opened this issue Feb 16, 2022 · 4 comments

Comments

@dvmarkusvogl
Copy link
Contributor

Short description

Currently the routing is done in dev via the config/webpack.dev.js and in prod via nginx in deploy/web/nginx-default.conf and copying over the generated deploy files.

Side info: The existance of config.webpack.prod.js isn't clear (Is it to generate a different deploy folder?), as we are (hopefully) not using nodejs/webpack as a webserver in prod.
It's also nearly 1:1 the dev file, with some minor changes in some places (so having 1 file that is configurable by args / env-vars / some .json settings would be nicer)

User stories

Just like the .dockerignore issue #500, this is done via a generators/workspace/templates/ file, and the behaviour can't easily be overridden,

In reprovisyn we want to route

  • the /api/v1/reprovisyn to our reprovisyn/superset docker container (currently done with an injection script)
  • everything else to /api (already working)

Other tools also employ multiple "microservice"-subservers (i.e. marvinjs) and to avoid CORS, such a routing strategy would be nice.

Possible solutions

Just like the .dockerignore issue, we'd like to make the routing at least configurable - there are multiple possible options:
a) Via allowing to override the webpack.dev.js (and the nginx-default.conf, which already works) - currently having one in the /template/config does nothing and having it in /config leads to phovea:update / phovea:setup-workspace asks you if you want to replace it by the default. (Expected behaviour: some way to override the default webpack.dev.js)
b) by generating the routes to webpack and nginx conf from some config (probably phovea_product.json?) or a new one.

Also at least some documentation for the webpack.prod file would be nice, as well as some documentation on how to override such a behaviour.

@thinkh
Copy link
Contributor

thinkh commented Feb 17, 2022

Side info: The existance of config.webpack.prod.js isn't clear (Is it to generate a different deploy folder?), as we are (hopefully) not using nodejs/webpack as a webserver in prod.

The webpack.prod.js is used to build the production bundle from the frontend files with npm run build.

@thinkh
Copy link
Contributor

thinkh commented Feb 17, 2022

I've posted a possible solution with #500 (comment).

@ghost
Copy link

ghost commented Feb 17, 2022

internally route via the yo-rc-workspace.json, externally via nginx config - and please don't override the webpack configs

@dvmarkusvogl
Copy link
Contributor Author

Finally really solved by #504

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

No branches or pull requests

2 participants