You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as a pattern, this was to save the effort of writing this each time:
import{Router}from'itty-router'import{error}from'itty-router-extras'constrouter=Router()// ... add some routesaddEventListener('fetch',event=>event.respondWith(router.handle(event.request).catch(err=>error(err.status||500,err.message))))
instead just doing this...
import{ThrowableRouter}from'itty-router-extras'constrouter=ThrowableRouter()// ... add some routesaddEventListener('fetch',event=>event.respondWith(router.handle(event.request)))
The question is... is this enough convenience to justify/support a barely-wrapped router? It's not a complicated thing, just not sure if it's worth it... thoughts/feedback is welcome!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is the proposition to kill
ThrowableRouter()
as a pattern, this was to save the effort of writing this each time:
instead just doing this...
The question is... is this enough convenience to justify/support a barely-wrapped router? It's not a complicated thing, just not sure if it's worth it... thoughts/feedback is welcome!
Beta Was this translation helpful? Give feedback.
All reactions