Skip to content

Refactored frontend routing and extended middleware response wrapper#47

Merged
ScriptyChris merged 3 commits intodevelopfrom
maintenance/refactor-frontend-routing-and-extend-middleware-response-wrapper
Nov 14, 2021
Merged

Refactored frontend routing and extended middleware response wrapper#47
ScriptyChris merged 3 commits intodevelopfrom
maintenance/refactor-frontend-routing-and-extend-middleware-response-wrapper

Conversation

@ScriptyChris
Copy link
Copy Markdown
Owner

@ScriptyChris ScriptyChris commented Nov 14, 2021

Partially related to #22.

  • frontend routing paths are now contextually grouped and exposed as constant
  • middleware response wrapper is extended to not only check whether data passed to .json(..) method conforms the interface, but also if it's consistent with certain group of HTTP status codes (like 'successful' or 'client error'). Wrapper also has overloads, which let sending just the HTTP status without any data (like in 204 case)

…n routing contexts (routes, redirections, links, history manipulations); Refactor frontend routing - subpages are now located under '/pages' path and shop related ones under '/shop' path; Add NotFound component, which handles unmatched routes (404 alike);
…tus' and 'data' value according to IEmbracedResponse interface;
…les to use resWrapper function for calls to Express.res method;
@ScriptyChris ScriptyChris added the maintenance Actions related to building, testing, refactoring etc. that don't directly affect using app label Nov 14, 2021
@ScriptyChris ScriptyChris merged commit 2635f72 into develop Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Actions related to building, testing, refactoring etc. that don't directly affect using app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant