Skip to content

Load redirects from content dir #689

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

Merged
merged 2 commits into from
Aug 6, 2025

Conversation

RubenSandwich
Copy link
Contributor

@RubenSandwich RubenSandwich commented Aug 5, 2025

Ticket

Redirects for local build are not pulling from local UDR API

Description

During local development we don't want to use the API to serve redirect files from /public, rather we want to read the redirect file in /content.

Testing

Local Dev

  1. Run locally npm run dev
    1. prebuild is not needed
  2. Edit a redirect file, such as:
    1. content/vault/v1.20.x/redirects.jsonc
  3. Go to the redirect API endpoint for that product to confirm your changes
    1. http://localhost:8080/api/content/vault/redirects

Preview/Production

  1. Make sure the redirect API is still working as intended:
    1. /api/content/vault/redirects
  2. process.env.NODE_ENV in vercel is always "production" when deployed on vercel's servers, so "development" should only ever happen locally

Copy link

github-actions bot commented Aug 5, 2025

Vercel Previews Deployed

Name Status Preview Updated (UTC)
Dev Portal ✅ Ready (Inspect) Visit Preview Tue Aug 5 19:24:09 UTC 2025
Unified Docs API ✅ Ready (Inspect) Visit Preview Tue Aug 5 19:18:33 UTC 2025

@RubenSandwich RubenSandwich marked this pull request as ready for review August 5, 2025 19:09
@RubenSandwich RubenSandwich requested a review from a team as a code owner August 5, 2025 19:10
Copy link
Contributor

@LeahMarieBush LeahMarieBush left a comment

Choose a reason for hiding this comment

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

I ran this locally and I'm still running into the issue where the local redirects are not being used. Here are the steps I took:

  1. Changed a redirect in one of the redirects files
  2. Ran make
  3. Went to the link I changed and it is still redirecting to the old link

Copy link
Contributor

@LeahMarieBush LeahMarieBush left a comment

Choose a reason for hiding this comment

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

Nvm, my redirect was cached so changing it did not work. LGTM!

@RubenSandwich RubenSandwich merged commit f860711 into main Aug 6, 2025
10 checks passed
@RubenSandwich RubenSandwich deleted the rn/load-redirects-from-content-dir branch August 6, 2025 19:20
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.

2 participants