Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I redirect to an existing single page application (SPA)

Fabian Schwarzkopf
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2018

I have a bundled single page application (SPA), that is build with Vue.js, and is working as is when served from a server. Now I want to create a confluence add-on that redirects to my SPA upon certain interaction.

What is the general setup for this? I found that jirban-jira is doing something similar, though it is an angular application and the setup is still unclear to me.

I've got it to the point, where my servlet renders a vm template that itself redirects to the download resources where I've placed the SPA and its index.html file. So the redirect part seems to be working. In fact, it is currently set up as the index.vm of the jirban-jira project.

Now the main problem seems to be that serving the SPA as a static download resource of the plugin does not work. Although the index.html is opened, all the relative paths within the SPA are not resolved correctly.

I assume that I need to serve the SPA differently, i.e. not as a download resource of my plugin. How do I do this and what is the URL under which it will be accessible then? Is there any public example of how to achieve this?

Or do I need to go down a totally different road, e.g. by using an i-frame somehow?

1 answer

1 accepted

0 votes
Answer accepted
Fabian Schwarzkopf
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2018

Nevermind, I got it working now. The problem was that the bundled index.html used references without './' prefix, e.g.

src=/static/.... instead of src=./static/....

replacing them seems to do the trick.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events