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

Redirect base URL to start page when running locally #319

Merged
merged 5 commits into from
Jan 3, 2025
Merged

Conversation

jdgage
Copy link
Contributor

@jdgage jdgage commented Dec 31, 2024

Description

Similar to how we have on WH:LG now, to get it off my to-do list

Checklist

  • I have made any necessary updates to the documentation
  • I have checked there are no unnecessary IDE warnings in this PR
  • I have checked there are no unintentional line ending changes
  • I have added tests where applicable
  • If I have made any changes to the code, I have used the IDE auto-formatter on it
  • If I have made any changes to website flow, I have updated the Flow Miro Board
  • If I have made any changes to website flow, I have checked forward and back behaviour is still consistent
  • If I have made any changes to content strings or resource files, I have followed the documentation

@samyou-softwire
Copy link
Contributor

I couldn't get this to work
image

the old URL does still work
image

@jdgage
Copy link
Contributor Author

jdgage commented Jan 2, 2025

@samyou-softwire Will be because your browser is using HTTPS rather than HTTP for the base path - if you manually change it then it should remember it for next time

@samyou-softwire
Copy link
Contributor

@samyou-softwire Will be because your browser is using HTTPS rather than HTTP for the base path - if you manually change it then it should remember it for next time

ah this worked thanks, though after making the change to http://localhost:5001/ it still redirects me to https://www.gov.uk/improve-energy-efficiency on local dev

@jdgage
Copy link
Contributor Author

jdgage commented Jan 2, 2025

@samyou-softwire Will be because your browser is using HTTPS rather than HTTP for the base path - if you manually change it then it should remember it for next time

ah this worked thanks, though after making the change to http://localhost:5001/ it still redirects me to https://www.gov.uk/improve-energy-efficiency on local dev

On this branch? Not what happens for me 🤔

@samyou-softwire
Copy link
Contributor

samyou-softwire commented Jan 2, 2025

@samyou-softwire Will be because your browser is using HTTPS rather than HTTP for the base path - if you manually change it then it should remember it for next time

ah this worked thanks, though after making the change to http://localhost:5001/ it still redirects me to https://www.gov.uk/improve-energy-efficiency on local dev

On this branch? Not what happens for me 🤔

purged my docker cache and this now seems to be working 👍

@jdgage
Copy link
Contributor Author

jdgage commented Jan 2, 2025

@Glenn-Clarke would you mind giving this a try as well to make sure everything's been ironed out?

@Glenn-Clarke
Copy link
Collaborator

@samyou-softwire Will be because your browser is using HTTPS rather than HTTP for the base path - if you manually change it then it should remember it for next time

ah this worked thanks, though after making the change to http://localhost:5001/ it still redirects me to https://www.gov.uk/improve-energy-efficiency on local dev

On this branch? Not what happens for me 🤔

cleared my cache and this now seems to be working 👍

Mine is taking me to the GDS homepage when I'm trying.
I've cleared my browser cache, Docker Images/Volumes, and manually typed http://

@Glenn-Clarke
Copy link
Collaborator

I've consulted with Sammy, and I'm clearing my docker cache. Will update when I have results

@Glenn-Clarke
Copy link
Collaborator

Mine doesn't seem to be benefiting from clearing the Docker cache like Sammy's did @jdgage

@Glenn-Clarke
Copy link
Collaborator

It doesn't appear that #if DEBUG is being respected, despite debug being selected as the configuration in my rider build options

jdgage added 3 commits January 2, 2025 18:31
The Dockerfile is used for deployed environments, so default to Release
configuration, but the docker-compose file is only used locally
@jdgage
Copy link
Contributor Author

jdgage commented Jan 2, 2025

As far as I can tell Rider is doing something magic and overriding the build configuration with whatever you've got selected when you run docker compose from there (@Glenn-Clarke I expect you've got Release selected in the dropdown next to the build/hammer icon if you check?). Which is wild, but useful to know I guess! When running docker compose up locally I'd reliably get it built in Release config as I would have expected from the Dockerfile.

I've made it so you'll always get the Debug config when running via docker-compose (which should only be the case when running locally - it will default to Release if you build directly from the Dockerfile) and then added a comment to explain what Rider's doing. I was also getting errors due to race conditions the first time I ran docker compose up locally as the app would try to start up before the database was ready, so I took the opportunity to fix that.

@Glenn-Clarke @samyou-softwire If you wouldn't mind re-testing quickly at some point I'd appreciate it!

@Glenn-Clarke
Copy link
Collaborator

Glenn-Clarke commented Jan 3, 2025

I've only just got in so I'll run through the rest of it, but just to confirm quickly: I've always had Debug selected in the little dropdown next to the hammer.

@Glenn-Clarke
Copy link
Collaborator

It works as expected now after your most recent commits; I get taken to the first question when I type in http://localhost:5001

Copy link
Contributor

@samyou-softwire samyou-softwire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me as well

@jdgage jdgage merged commit fc3b37f into dev Jan 3, 2025
2 checks passed
@jdgage jdgage deleted the local-dev-redirect branch January 3, 2025 12:27
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

Successfully merging this pull request may close these issues.

3 participants