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

Get dApp to work with relative paths on index.html #1749

Closed
andrevmatos opened this issue Jun 19, 2020 · 3 comments · Fixed by #1754
Closed

Get dApp to work with relative paths on index.html #1749

andrevmatos opened this issue Jun 19, 2020 · 3 comments · Fixed by #1754
Assignees
Labels
dApp 📱 infrastructure 🚧 Tests, CI, and general project infrastructure

Comments

@andrevmatos
Copy link
Contributor

andrevmatos commented Jun 19, 2020

Description

As part of #1511 , I've developed an nginx docker setup which is able to load the artifacts from a CircleCI build and serve them in a local path. The idea is that by and upon acessing e.g. http://localhost:8888/pull/1745/ , one can see the latest build for the #1745. But this needs the webApp to work with relative URLs (in this case, /pull/1745/) for assets and routes/redirects.

We need to have a relative publicPath in vue.config.js, like publicPath: './'. This way, the assets for the dApp is downloaded from the path relative to the one from which the index.html file was loaded (ie. js/... instead of /js/...). This should also do it for /staging/. Last bit is fixing redirection to root /, which keeps happening when accessing the index file directly on the relative path.

Acceptance criteria

  • dApp's assets are fetched relative to the path index.html was loaded
  • Routes and redirections honor relative path of index file

Tasks

  • [ ]
@andrevmatos andrevmatos added dApp 📱 infrastructure 🚧 Tests, CI, and general project infrastructure labels Jun 19, 2020
@christianbrb
Copy link
Contributor

Should we do that? It would mean, that I would need to create new channels and deposit to the UDC for every manual test run as the Raiden Account changes with every new URL.

Another option would be to remove the URL from the Raiden Account signature generation process ;)

@andrevmatos
Copy link
Contributor Author

No, this is precisely to avoid you having a Raiden Account for each PR's deployment. The Raiden Account is unique per blockchain and per hostname, so with the service I wrote, only the path changes, the domain is always the same (https://localhost:8888/ here on my local machine), and therefore the same Raiden Account is generated. But we need to have different files served for each path (one for each PR) and for the SPA to work fine on these subpaths (usually it expects to be runing in the root of the host).

@christianbrb
Copy link
Contributor

Comment from @kelsos

  • CircleCI configuration
  • Check SPA workaround for proper history (maybe this is the code which affects it)

@andrevmatos andrevmatos linked a pull request Jun 19, 2020 that will close this issue
3 tasks
@andrevmatos andrevmatos self-assigned this Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dApp 📱 infrastructure 🚧 Tests, CI, and general project infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants