Thoughts on salvo #140
prabirshrestha
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Thanks for your feedback.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is similar to trillium-rs/trillium#117. I have been using trillium but due lack of proper handling have been looking into trying to find a different framework. Before this was using tide so here are some of my thoughts based on migrating my blog to salvo prabirshrestha/rblog#103.
I love trillium apis as it is very simple to understand. Salvo seems to be in similar mindset as trillium.
#[handler]
macros. Seems to have been mentioned Consider dropping need for macro in place of traits and function pointers. #9.Trillium uses the following api.
This is very similar to the handler function in salvo.
Would be good to have similar api as trillium where the
Context
orConn
contains request, depot, response and ctrl. This is also similar to a popular go lang framework echo and nodejs koajs. This makes it easy to transfer knowledge from other frameworks.Conn
. If Salvo hadContext
orConn
concept this would make it easy. In trillium I have found discovering apis is very easy.As mentioned in here I had hard time finding how to send a file. add example for sending a file via NamedFile/NamedFileBuilder #137. This could had looked something like this.
Another example where this could be useful is when rendering templates. For example in order to port https://github.com/prabirshrestha/trillium-ructe to salvo I don't know what api I should expose. In trillium I just extend the
Conn
, it could had looked likectxt.render_html(|o| template::home(o))
.Beta Was this translation helpful? Give feedback.
All reactions