4 ms·
I'm curious too. I would love to see someone make nearly an exact clone of Express (the sinatra inspired lib for Node) but for Go. Basically something that sup
by rartichoke 14y ago
I'm curious too. I would love to see someone make nearly an exact clone of Express (the sinatra inspired lib for Node) but for Go.
Basically something that supports the concept of:
- Arbitrary middleware as long as you adhere to a specific signature.
- Proper caching at the http request/response level for dynamic templates.
- Keep the router separate so you can plugin Pat or the Gorilla Muxer (both of them are much different IMO).
- Add some niceties like setting proper headers for certain popular responses (json or templates, etc.) or easily distinguishing if the request is an XHR or not so you can either render a template or json with a quick boolean check.
- Implement Gorilla's session handler or some other solution and expose it in a really clean way that's also easy to plugin different session adapters (app memory, redis, etc.).
- Some functionality of what "res.locals" does in Express.
I honestly feel like part of the reason why Node is so popular is because of Express. tj did a tremendous job making a very out of the way but ridiculously useful web library.