Hacker News new | past | comments | ask | show | jobs | submit login

I don't think there necessarily is a default production webserver setup. People use different routers or frameworks, or go bare bones because they can.

You asked for an example, and here is one. This is my side project "ntfy", which runs a web app and API and handles hundreds of thousands of requests a day and thousands of constantly active socket connections. It uses no router framework, and has a modified (enhanced version of the http.HandlerFunc) that can return errors. It also implements a errHTTP error type that allows handler functions to return specific http error codes with log context and error message.

It is far from the most elegant, but to me Go is not about elegance, it's about getting things done.

https://github.com/binwiederhier/ntfy/blob/main/server/serve...

The server runs on https://ntfy.sh, so you can try it out live.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: