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

After building , navigating to "app1" gives 404 #72

Open
ajaykumarsana opened this issue Nov 6, 2020 · 3 comments
Open

After building , navigating to "app1" gives 404 #72

ajaykumarsana opened this issue Nov 6, 2020 · 3 comments

Comments

@ajaykumarsana
Copy link

Hi @joeldenning @Vallerious ,

  • cd navbar && npm ci && npm run build:single-spa
  • cd ../app1 && npm ci && npm run build:single-spa
  • cd ../app2 && npm ci && npm run build:single-spa
  • cd .. && mkdir static && cp -a navbar/dist app1/dist app2/dist static
  • cp root-html-file/index.html static
  • sed -i 's/http://localhost:4201/main//dist/app1/main/g' static/index.html
  • sed -i 's/http://localhost:4202/main//dist/app2/main/g' static/index.html
  • sed -i 's/http://localhost:4300/main//dist/navbar/main/g' static/index.html
  • cp static/index.html static/200.html
  • echo "The static directory uploaded to surge:"
  • find static

i tried to build by using above steps, i've got my static folder ready, When i put static folder inside apache or other server, I was able to load initial page properly.
The issue is when i navigate to '/app1' or '/app2' 'm getting 404 error.

Can you please help.

@tungurlakachakcak
Copy link
Contributor

Hi @ajaykumarsana !
You would have to tell apache to serve the index.html on every request, no matter if it's /app1, /app2, /, /some-other.
single-spa-router would take care of the in-app routing.

By the way, you have double slashes in your sed command (http://localhost:4201/main//dist/app1/main/g). How does that work?

@ajaykumarsana
Copy link
Author

Hi @ajaykumarsana !
You would have to tell apache to serve the index.html on every request, no matter if it's /app1, /app2, /, /some-other.
single-spa-router would take care of the in-app routing.

By the way, you have double slashes in your sed command (http://localhost:4201/main//dist/app1/main/g). How does that work?

Hi @Vallerious ,
Thanks for response,
i manually replaced 'http://localhost:4201/main.js' with '/dist/app1/main.js' .
And Could you please tell me how to tell apche to serve index.html for every request?

@ajaykumarsana
Copy link
Author

@Vallerious , @joeldenning
Any solution?

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