feat: Adding routes handling, always going through ROUTES instead of hardcoded everywhere#6886
Draft
DennisGaida wants to merge 11 commits intolouislam:masterfrom
Draft
feat: Adding routes handling, always going through ROUTES instead of hardcoded everywhere#6886DennisGaida wants to merge 11 commits intolouislam:masterfrom
DennisGaida wants to merge 11 commits intolouislam:masterfrom
Conversation
1 task
Collaborator
|
Looks interesting. |
…with no extension
…ts with no extension
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I am fully aware this touches a lot of files, but in the end it all references back to
routes.ts. Even if you don't like the URLs I am proposing (/admin/...), these could be easily changed in theroutes.tsto the previous URLs/paths, but we would get away from those hardcoded paths.In this pull request, the following changes are made:
Implemented
routes.tsso all routes go through it for UX/UI and pretty URLsRemoves all hardcoded URLs / paths everywhere and I hope I haven't missed a spot
I tried testing all paths and all functionalities as well as setting up a completely new UK instance
All legacy URLs are being redirected automatically (see
routes.json the bottom) - no broken bookmarks/linksDocumentation & Tests never reference paths directly hence nothing to update
I don't know how to do CI tests locally, so I didn't do that next to
npm run dev,npm run tscandnode server/server.js, maybe there are some automatic GH actions?Resolves Consistent routes / URIs for easier security hardening #2505
Please follow this checklist to avoid unnecessary back and forth (click to expand)
I understand that I am responsible for and able to explain every line of code I submit.