free-programming-books-search icon indicating copy to clipboard operation
free-programming-books-search copied to clipboard

[BUGFIX-37] Relative urls with a harcoded contextPath

Open davorpa opened this issue 3 years ago • 3 comments

What does this PR do?

Add feature(s) | Fix

Description

Allow install app in other context path different to /free-programming-books-search to increase flexibility

Context

Resolves #37

Test deploy: https://davorpa.github.io/free-programming-books-search/ Check:

  • H1 link goes to homepage /free-programming-books-search/
  • Any link in homepage goes to it related file (docs or listings)
  • No extra ampersand in them before sect parameter

davorpa avatar Sep 16 '22 09:09 davorpa

is this to make it easier to test?

eshellman avatar Sep 18 '22 13:09 eshellman

is this to make it easier to test?

Sorry sir :worried:. Not sure at all until deploy (execute npm run deploy from a cmd) with a production build

In local development works but in github.io I don't know because my environment is broken. I doubt if after apply this PR the context path is / or /free-programming-books-search

Maybe it lefts to add a .env.production file to force values for this build profile according to https://create-react-app.dev/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env

A revert is always possible in the worst of cases

How to test if works...

image

davorpa avatar Sep 18 '22 15:09 davorpa

Fresh news after fix my deploy environment

It works like expected. https://davorpa.github.io/free-programming-books-search/ without any .env file. Maybe due to package.json homepage attribute is setted.

  • H1 link goes to homepage /free-programming-books-search/
  • Any link in homepage goes to it related file (docs or listings)
  • No extra ampersand in them before sect parameter

If you want be sure at local you always checkout this PR make a build and... follow steps posted in #39

davorpa avatar Sep 18 '22 15:09 davorpa