6 ms·
> URL redirection Erm, just return a new url after the match? Get fancy with state machine like enums? Rust has everything you need here, not getting why you t
by dakom 2y ago
> URL redirection
Erm, just return a new url after the match? Get fancy with state machine like enums? Rust has everything you need here, not getting why you think this requires a framework.
> Specific management of [...]
again, match for that, map your url parts, whatever - it doesn't need a 10,000 pound gorilla when it can be done in a line or two of code
> complex regex matching
erm, regex crate?
> Django, Laravel, Rails
Yup, those are valid choices. I said it's not a framework problem necessarily.
Not a one size fits all sorta problem.
Wordpress is also a fine choice if your business is knocking out new sites for a new client every month.
But, if you're building a single product over the course of a year or two, it's not the end of the world to spend a couple weeks rolling your own auth and hook it up to transactional emails and everything else. It's just one small problem to deal with, not major in the grand scheme of things. YMMV
- Daishiman 2y ago> Rust has everything you need here, not getting why you think this requires a framework. Because you're reinventing a wheel that doesn't need reinvention, and the most likely thing is that you will neither reinvent it nor pick the best library that an opinionated framework with hundreds of eyeballs has. > again, match for that, map your url parts, whatever - it doesn't need a 10,000 pound gorilla when it can be done in a line or two of code Sufficiently large and complex websites will have that need. > But, if you're building a single product over the course of a year or two, it's not the end of the world to spend a couple weeks rolling your own auth and hook it up to transactional emails and everything else. It's just one small problem to deal with, not major in the grand scheme of things. YMMV No individual problem is large, but it is objectively a dozen little problems, all with a nontrivial chance to blow up into larger problems. Code reuse and frameworks exist because, unless you've been doing web development for a long time, you _will_ run into issues that have already been solved.
- dakom 2y agoI don't think you get how powerful Rust's pattern matching is, or how to think of it in terms of a router. From my example above, check out https://github.com/dakom/dominator-workers-fluent-auth/blob/822b5bbfb188141e3164a3321779392dc088b1b5/shared/src/backend/route.rs#L39 https://github.com/dakom/dominator-workers-fluent-auth/blob/... and follow it through to https://github.com/dakom/dominator-workers-fluent-auth/blob/822b5bbfb188141e3164a3321779392dc088b1b5/shared/src/backend/route.rs#L98 https://github.com/dakom/dominator-workers-fluent-auth/blob/... Do you see that you have static and dynamic parts matching, multiple variable capture, etc.? I'm not talking from a theoretical perspective. I'm showing you an actual example of a fully baked auth system that does everything on the wishlist (and more) and has no need at all for a router because Rust is itself powerful enough to do all that out of the box
- wtetzner 2y ago> and the most likely thing is that you will neither reinvent it nor pick the best library that an opinionated framework with hundreds of eyeballs has. Having used Spring has convinced me that framework popularity has no correlation with quality.
- Daishiman 2y agoSpring is still better than 95% of those microframework users end up reinventing in the wild, and I hate Spring with a passion.