5 ms·
Ask HN: What GO web framework do you use?
Hello HN , what to use to be fast and easy like java's tomcat server ?
So many half baked or not maintained frameworks...
What do I use in production?
- dcchambers 4y agonet/http. Go has great web support in the standard library.^1 Kidding aside, I didn't think that full-fledged web frameworks (akin to Ruby-on-Rails, Flask, Spring, etc) were really a thing with Go - or at least not a super popular thing. And you should be able to pretty easily recreate the functionality of a Tomcat-like web server using the http/net library.^2 [1]: https://pkg.go.dev/net/http https://pkg.go.dev/net/http [2]: https://go.dev/doc/articles/wiki/ https://go.dev/doc/articles/wiki/
- karanbhangui 4y agohttps://echo.labstack.com/ https://echo.labstack.com/
- dougbarrett 4y agoI've been using echo for years. Has a great balance of adding helpful utilities while also not imposing bad patterns.
- yashasolutions 4y agoGin
- deleted 4y ago[deleted]
- umen 4y agoIn production?
- tmaly 4y agoI have used Gin in the past and have really liked it.
- matthewmueller 4y agoFor simple, battle-tested web server, you can't go wrong with net/http. A couple of us are working on Bud (http://github.com/livebud/bud http://github.com/livebud/bud), which aims to be a full-stack web framework for Go, similar to Laravel or Rails. The project is getting better very quickly! If you're working on a greenfield project and want more out of the box, I'd encourage you to give Bud a try!
- wkdneidbwf 4y agolooks cool!
- _benj 4y agoJust stared it! I use Go at work and it’s a joy but I’m currently Lea Laravel because it makes getting something out so easy! I’m was blown away yesterday when I learned how to handle file uploads in laravel, and Breeze allows me to have out of the box user auth in about 5 mins? I’ve built all of that in Go and it was probably two months of work… This is not to discourage you, it would be absolutely terrific to have a proper full-stack framework in Go! And just as an aside from what I see in laravel, if making part of the framework commercial is a way to give the project a boost I think it’d be worth it! Tailwind also comes to mind following the same model. Full open source but if you want a working starter template, payments, teams, subscriptions, etc… I’d pay for that!
- elt 4y agoI use the standard library. My entire business runs on it, html/css all through the standard library (templates package). I use embed to embed all assets in the binary itself. "go build" and then "scp" the binary to the production server and "systemctl restart appserver"
- JodieBenitez 4y ago> templates package How do you like the template package ? Can you compare it to Jinja/Twig ?
- elt 4y agoI have never used Jinja/Twig, but I have used handlebars, ERB, JSX and other similar templating systems. Overall, I find Go's template system to be a bit clunky but it certainly gets the job done. The template system is fairly minimal so it feels mostly like working with HTML, but it gives you a few tools to use.. mainly passing data down the template/sub-templates and the ability to define template functions/helpers. Minimal... but it's all you really need. I converted my business from Rails 5 to Go about a year ago and the ERB was fairly straight forward to convert to Go's template system.. it felt like I was mostly converting <% .. %> to {{ .. }} and changing <%= render ... %> to {{ template ... }}
- JodieBenitez 4y agoThanks, I guess I should try the standard lib before anything else then.
- DLA 4y agoLove that you do this. I have a few enterprise projects that do exactly the same thing (minus the embed in one, just scp and untar). Can’t beat the simplicity. Regarding the original question we use fiber.io for a few systems and have loved it’s capabilities and performance.
- bgdkbtv 4y agoWhat about scheduled jobs (cron), email notifications, database etc?
- kgraves 4y agoI use Fiber [0] in production for a $4M ARR company and never had any issues even at peak traffic. Took less than a month to start with and integrate and it is a joy to use. [0] https://github.com/gofiber/fiber https://github.com/gofiber/fiber
- bgdkbtv 4y agoWhy do most Go framework websites look like they were made by uni students for their side projects? https://gin-gonic.com/ https://gin-gonic.com/ https://echo.labstack.com/ https://echo.labstack.com/ https://gobuffalo.io/ https://gobuffalo.io/ Compare that to Laravel for example: https://laravel.com/ https://laravel.com/
- ev1 4y agoengineering design, not design design
- viginti_tres 4y ago1.7 MB for the echo landing page, 3 MB for laravel landing page. I think that's why
- newusertoday 4y agoyou can use standard library unlike other langauages golang has built in support for db[1], timer to schedule tasks[2], emails[3], templates[4] etc. and your application would be fairly upgrade proof. If you insist on using framework you can use echo or gofiber. There is also pockebase.io it uses echo internally but comes with user management etc. built in. [1] https://pkg.go.dev/database/sql https://pkg.go.dev/database/sql [2] https://pkg.go.dev/time https://pkg.go.dev/time [3] https://pkg.go.dev/net/smtp https://pkg.go.dev/net/smtp [4] https://pkg.go.dev/text/template https://pkg.go.dev/text/template [3]
- jamietanna 4y agoWe've got a mix of a few but are recommending use of https://github.com/gorilla/mux https://github.com/gorilla/mux due to it using the net/http interfaces and types, great performance and some configurability which can be handy. In particular, my team is using it in conjunction with generated code https://deliveroo.engineering/2022/06/27/openapi-design-first.html https://deliveroo.engineering/2022/06/27/openapi-design-firs...