Title: Less mess up potential when registering middleware and controllers by making the order of registration irrelevant · Issue #2 · JavaWebStack/web-framework · GitHub
Open Graph Title: Less mess up potential when registering middleware and controllers by making the order of registration irrelevant · Issue #2 · JavaWebStack/web-framework
X Title: Less mess up potential when registering middleware and controllers by making the order of registration irrelevant · Issue #2 · JavaWebStack/web-framework
Description: Is your feature request related to a problem? Please describe. When the controllers are registered before the middlewares the middlewares don't work or kick into action. I was confused about this and this is a potential for frustration a...
Open Graph Description: Is your feature request related to a problem? Please describe. When the controllers are registered before the middlewares the middlewares don't work or kick into action. I was confused about this a...
X Description: Is your feature request related to a problem? Please describe. When the controllers are registered before the middlewares the middlewares don't work or kick into action. I was confused about th...
Opengraph URL: https://github.com/JavaWebStack/web-framework/issues/2
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Less mess up potential when registering middleware and controllers by making the order of registration irrelevant","articleBody":"**Is your feature request related to a problem? Please describe.**\r\nWhen the controllers are registered before the middlewares the middlewares don't work or kick into action. I was confused about this and this is a potential for frustration and wasted time debugging.\r\n\r\n**Describe the solution you'd like**\r\nThe order of registration becomes irrelevant.\r\n\r\n**Describe alternatives you've considered**\r\nProviding informative information via the logger on at least warning level.\r\n\r\n**Additional context**\r\n\r\nWorking code sample:\r\n\r\n```\r\n public void setupServer(HTTPServer httpServer) {\r\n httpServer.middleware(\"auth\", new AuthenticationMiddleware());\r\n httpServer.beforeAny(\"/api\", new AuthenticationMiddleware());\r\n httpServer.controller(HttpController.class, RootController.class.getPackage());\r\n }\r\n```\r\n\r\nUnexpetedly broken sample:\r\n\r\n```\r\n public void setupServer(HTTPServer httpServer) {\r\n httpServer.controller(HttpController.class, RootController.class.getPackage());\r\n httpServer.middleware(\"auth\", new AuthenticationMiddleware());\r\n httpServer.beforeAny(\"/api\", new AuthenticationMiddleware());\r\n }\r\n```","author":{"url":"https://github.com/TimothyGillespie","@type":"Person","name":"TimothyGillespie"},"datePublished":"2021-03-02T01:29:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/web-framework/issues/2"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1e6e05c6-d797-18d4-458e-605d4627aba7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E448:335FF6:466BB20:5BD7CF9:697DC1C4 |
| html-safe-nonce | c3d5086332ee28fe9c485929a6147175ae410e6b2ba3513374c01b8e9c92ec07 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDQ4OjMzNUZGNjo0NjZCQjIwOjVCRDdDRjk6Njk3REMxQzQiLCJ2aXNpdG9yX2lkIjoiMjc3Mzg5MjA2MjgxNzE0MTE4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f323f42b8dfd4852021f4b4c5e222aac912def4fcb694e0732f7ffa838c8d2e8 |
| hovercard-subject-tag | issue:819506872 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaWebStack/web-framework/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/862e3f7ddf2fed022afdc62a2c0cb6aaa36486e4fc8d067864c79acdd41db45c/JavaWebStack/web-framework/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/862e3f7ddf2fed022afdc62a2c0cb6aaa36486e4fc8d067864c79acdd41db45c/JavaWebStack/web-framework/issues/2 |
| og:image:alt | Is your feature request related to a problem? Please describe. When the controllers are registered before the middlewares the middlewares don't work or kick into action. I was confused about this a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TimothyGillespie |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaWebStack/web-framework git https://github.com/JavaWebStack/web-framework.git |
| octolytics-dimension-user_id | 73674659 |
| octolytics-dimension-user_login | JavaWebStack |
| octolytics-dimension-repository_id | 308483692 |
| octolytics-dimension-repository_nwo | JavaWebStack/web-framework |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 308483692 |
| octolytics-dimension-repository_network_root_nwo | JavaWebStack/web-framework |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width