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

move shortlink redirect logic to middlware #1233

Merged
merged 1 commit into from
Oct 23, 2023
Merged

move shortlink redirect logic to middlware #1233

merged 1 commit into from
Oct 23, 2023

Conversation

wesbos
Copy link
Collaborator

@wesbos wesbos commented Oct 23, 2023

the /[show_number]/page.svelte was running a DB query on every unmatched /anything route and causing a prisma error.

This moves this logic into the middlware stack, and leaves all the error handling and 404s up to the svelte router.

This will allow us to implement /shortlinks easier in the future as well

@vercel
Copy link

vercel bot commented Oct 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
syntax-website ✅ Ready (Inspect) Visit Preview Oct 23, 2023 2:57pm

@wesbos
Copy link
Collaborator Author

wesbos commented Oct 23, 2023

Fixes #1232

@wesbos wesbos merged commit bbe4a03 into main Oct 23, 2023
@stolinski stolinski deleted the issue-1232 branch April 5, 2024 18:18
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.

1 participant