[{"data":1,"prerenderedAt":443},["ShallowReactive",2],{"project-16090977":3},{"id":4,"name":5,"line":5,"line_source":6,"title":7,"url":8,"domain":9,"maker":10,"posted_at":11,"year":12,"points":13,"comments":14,"rank_in_year":15,"shown_in_year":16,"top":17,"tier":18,"category":19,"subcategory":20,"format":21,"keywords":22,"reception":27,"sentiment":28,"stance_mix":29,"scored_comments":32,"aspects":33,"strip":38,"post_text":40,"what":41,"said":71,"maker_in_thread":162,"shape":171,"grid":174,"attempts":404,"same_week":405,"maker_shows":39,"maker_hidden":435,"reader_version":436,"card":437},"16090977","A simple Go web server with logging, tracing, health check","title","Show HN: A simple Go web server with logging, tracing, health check","https:\u002F\u002Fgist.github.com\u002Fenricofoltran\u002F10b4a980cd07cb02836f70a4ab3e72d7","gist.github.com","enricofoltran",1515336020,2018,318,91,75,2155,4,"legend","languages","web server reference","other",[23,24,25,26],"go web server","golang health check","golang middleware","graceful shutdown go","debated",0.071,{"positive":30,"neutral":17,"mixed":31,"critical":17},7,1,16,{"idea":34,"docs":36},{"positive":35,"critical":17},5,{"positive":31,"critical":37},0,[39,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,39,37,37,37,37,35,37,31,35,31,37,39,35,31,37,37,35,39,35,37,37],3,null,{"problem":42,"audience":40,"pricing":40,"motivation":52,"time_to_build":40,"stack":57,"openness":70,"stage":70,"team_size":70},{"value":43,"source":44,"evidence":45},"Reminder of how to wire up logging, tracing, health check and graceful shutdown in a Go web server using only the standard library","maker",[46,49],{"id":47,"by":10,"text":48},"16091242","Hi Ultimatt, this is just a reminder for me on how to do those things when I start a new app in Go, instead of always google for them. Didn't expect to hit the homepage!",{"id":50,"by":10,"text":51},"16091102","Hi chrisper, you are right! This is just a reminder for me on how to do those things when I start a new app in Go, instead of always google for them.",{"value":53,"source":44,"evidence":54},"A reminder for the maker on how to do these things when starting a new Go app, instead of googling them",[55,56],{"id":47,"by":10,"text":48},{"id":50,"by":10,"text":51},[58],{"value":59,"source":60,"evidence":61},"Go","inferred",[62,66],{"id":63,"by":64,"text":65},"16091118","Xeoncross","Can someone add letsencrypt.org ACME cert generation? https:\u002F\u002Fgodoc.org\u002Fgolang.org\u002Fx\u002Fcrypto\u002Facme\u002Fautocert Edit: found this…",{"id":67,"by":68,"text":69},"16091597","twic","Here's a quick attempt at the same thing in Java (although note that the command line format is different):…","unknown",{"praise":72,"objections":92,"requests":111,"questions":124,"alternatives":139},[73,85],{"value":74,"source":75,"evidence":76},"Useful reference showing best practices for Go servers","commenter",[77,81],{"id":78,"by":79,"text":80},"16091656","AndrewStephens","Thanks for this. I have been writing toy golang servers for a while to try out various ideas and this really helps clarify some useful techniques and best practices.",{"id":82,"by":83,"text":84},"16091395","oppositelock","It's a nice reference program to show you what's going on. I build stuff like this for a living. I'd recommend not re-inventing the wheel yourself and using a nice web framework,…",{"value":86,"source":75,"evidence":87},"Impressive to do it in about a hundred lines using only the standard library",[88],{"id":89,"by":90,"text":91},"16091112","striking","To do all of this in just over a hundred lines of code without having to import packages to do it is pretty incredible. It may be just an exercise but it is a very cool one.",[93,104],{"value":94,"source":75,"evidence":95},"Standalone web server has little practical use; a reference, not a tool",[96,100],{"id":97,"by":98,"text":99},"16091085","chrisper","I do not quite see the point of this (other than being an exercise). We already have web server that do \"logging, tracing, health check, graceful shutdown.\" I do not care about…",{"id":101,"by":102,"text":103},"16091211","Ultimatt","So a hundred lines of pure boilerplate hooking up Go standard libraries, assumedly exactly how they were intended to be used. How is this news worthy?",{"value":105,"source":75,"evidence":106},"Standard-library-only approach is a poor reason to avoid dependencies for some",[107],{"id":108,"by":109,"text":110},"16091429","allover","> We should always try to strive to lower dependencies when it makes sense. Maybe, but I think 'when it makes sense', might be 'rarely'. There a 2 ways to avoid dependencies: 1.…",[112,120],{"value":113,"source":75,"evidence":114},"Add Let's Encrypt ACME certificate generation",[115,116],{"id":63,"by":64,"text":65},{"id":117,"by":118,"text":119},"16091974","skanga","Nice. Does anyone have a server like this but with the addition of * serving of files and directories * LetsEncrypt certificates and SSL",{"value":121,"source":75,"evidence":122},"Add static file serving",[123],{"id":117,"by":118,"text":119},[125,132],{"value":126,"source":75,"evidence":127},"How is this different from Caddy, which is also written in Go?",[128],{"id":129,"by":130,"text":131},"16091195","coldcode","Isn't Caddy written in Go? How is this different?",{"value":133,"source":75,"evidence":134},"Which Go web framework has a Django-like back-office scaffolding?",[135],{"id":136,"by":137,"text":138},"16091526","rcarmo","This reminds me of an ongoing discussion I was having with friends about Golang web frameworks -- one side of the argument is that you can achieve so much with the standard…",[140,144,148,155],{"value":141,"source":75,"evidence":142},"Echo and Gin web frameworks",[143],{"id":82,"by":83,"text":84},{"value":145,"source":75,"evidence":146},"Caddy",[147],{"id":129,"by":130,"text":131},{"value":149,"source":75,"evidence":150},"Finagle HTTP server for Java",[151],{"id":152,"by":153,"text":154},"16092271","SEJeff","If you're using java, just use finagle's http server and be done with it. It is really good and runs most all of twitter.com's production web services. The very definition of…",{"value":156,"source":75,"evidence":157},"Jetty and Spring with Tomcat",[158],{"id":159,"by":160,"text":161},"16094301","rb808","Jetty does everything, else Spring with tomcat. I don't see any reason to rely on JDK web server (which I've never seen anyone seriouosly use.",{"comments":17,"answered":31,"key":163},[164,167,170],{"id":165,"text":166},"16091765","Hi twic, thanks for sharing this! I love to see implementation in other languages. I'm particularly interested in Rust, it would be awesome if anyone can make a attempt! :)",{"id":168,"text":169},"16091527","Hi grzm, you are probably right. Can I do this myself? editing the title with a \"Show HN\" prefix is sufficient?",{"id":47,"text":48},{"commenters":172,"max_depth":30,"maker_replies":17,"first_comment_mins":173,"lifespan_hours":15},63,33,[175,177,181,184,185,188,190,193,196,198,200,203,205,208,210,212,215,218,221,224,227,230,233,236,238,240,243,246,249,251,252,255,258,260,261,264,267,269,272,274,276,278,281,282,284,287,290,293,296,298,301,303,306,308,311,314,316,320,321,323,325,328,329,333,337,340,343,346,349,352,354,356,360,362,363,365,367,370,373,376,379,380,382,384,387,389,392,394,396,398,401],[63,37,39,176,64,37],"project\u002Fneutral\u002Fidea",[178,37,37,179,180,37],"16091825","commenter\u002Fneutral\u002Fnone","tonetheman",[182,37,37,183,64,37],"16099477","other\u002Fneutral\u002Fnone",[136,31,37,183,137,37],[186,31,37,183,187,37],"16091542","nishs",[189,31,37,183,137,37],"16091703",[191,31,37,183,192,37],"16092030","golangnews",[194,31,37,179,195,37],"16102942","iris-go",[197,31,37,179,195,37],"16102934",[199,31,37,183,187,37],"16091607",[201,31,37,183,202,37],"16091610","bsaul",[204,31,37,183,137,37],"16091691",[206,31,37,183,207,37],"16091736","y4mi",[209,31,37,183,137,37],"16091751",[211,31,37,183,202,37],"16092184",[213,31,37,179,214,37],"16094084","sd8dgf8ds8g8dsg",[216,31,37,179,217,37],"16093140","dualogy",[219,31,37,183,220,37],"16093173","dy",[222,31,37,183,223,37],"16094950","billhathaway",[225,31,37,183,226,37],"16092673","e12e",[228,31,37,183,229,37],"16092915","grajaganDev",[231,31,37,183,232,37],"16093052","konart",[234,31,37,183,235,37],"16094747","tacticus",[67,237,37,183,68,37],2,[165,237,37,239,10,31],"maker\u002Fneutral\u002Fnone",[241,237,37,183,242,37],"16091878","AsyncAwait",[244,237,37,179,245,37],"16091908","meddlepal",[247,237,37,179,248,37],"16091925","setheron",[250,237,37,179,68,37],"16095973",[117,237,37,183,118,37],[253,237,37,183,254,37],"16092515","wyattjoh",[256,237,37,179,257,37],"16094108","TheDong",[259,237,37,183,214,37],"16093915",[152,237,37,183,153,37],[262,237,37,179,263,37],"16092813","michaelmcmillan",[265,237,37,179,266,37],"16092901","ianamartin",[268,237,37,179,153,37],"16092963",[270,237,37,179,271,37],"16094303","xstartup",[273,237,37,179,153,37],"16094497",[275,237,37,179,68,37],"16095872",[277,237,37,179,153,37],"16111321",[279,237,37,179,280,37],"16094172","dboreham",[159,237,37,179,160,37],[82,39,39,283,83,37],"project\u002Fmixed\u002Fidea",[285,39,37,179,286,37],"16091792","sethammons",[288,39,37,183,289,37],"16092082","dstroot",[291,39,37,179,292,37],"16094330","pdappollonio",[294,17,37,183,295,37],"16091369","akditer",[297,17,37,183,286,37],"16091820",[299,17,37,179,300,37],"16091874","Liru",[302,17,37,179,286,37],"16091902",[304,17,37,183,305,37],"16091941","freyir",[307,17,37,183,295,37],"16092409",[309,17,37,183,310,37],"16093048","cdoxsey",[312,17,37,179,313,37],"16116815","igouy",[78,35,35,315,79,37],"project\u002Fpositive\u002Fdocs",[317,318,37,183,319,37],"16091465",6,"grzm",[168,318,37,239,10,31],[322,318,37,183,319,37],"16091556",[101,30,31,324,102,37],"project\u002Fcritical\u002Fidea",[326,30,37,183,327,37],"16091234","marter",[47,30,37,239,10,31],[330,30,35,331,332,37],"16091270","project\u002Fpositive\u002Fnone","avg_dev",[334,335,31,324,336,37],"16091255",8,"MrF3ynmann",[338,335,37,179,339,37],"16091297","zzzcpan",[341,335,37,179,342,37],"16091317","eeZah7Ux",[344,335,37,179,345,37],"16091356","rhencke",[347,335,37,179,348,37],"16091350","weberc2",[350,335,37,179,351,37],"16091868","ovao",[129,353,39,176,130,37],9,[355,353,39,176,348,37],"16091206",[357,353,35,358,359,37],"16091331","project\u002Fpositive\u002Fidea","mholt",[97,361,31,324,98,37],10,[50,361,37,239,10,31],[364,361,37,183,98,37],"16091377",[366,361,37,183,319,37],"16091444",[368,361,37,183,369,37],"16091520","jasonlotito",[371,361,37,183,372,37],"16091977","35bge57dtjku",[374,361,37,183,375,37],"16095031","dang",[377,361,35,358,378,37],"16091104","tbrock",[89,361,35,358,90,37],[381,361,31,324,98,37],"16091379",[383,361,37,179,90,37],"16092308",[385,361,35,358,386,37],"16091157","gchamon",[388,361,39,176,348,37],"16091214",[390,361,35,358,391,37],"16091273","sergiotapia",[393,361,37,179,98,37],"16091387",[395,361,37,179,109,37],"16091445",[108,361,37,397,109,37],"commenter\u002Fneutral\u002Fidea",[399,361,37,179,400,37],"16092641","013a",[402,361,37,183,403,37],"16093807","marcus_holmes",[],[406,411,416,421,426,430],{"id":407,"name":408,"points":409,"category":410},"16070394","PAST",362,"security_privacy",{"id":412,"name":413,"points":414,"category":415},"16086800","Eel",201,"dev_tools",{"id":417,"name":418,"points":419,"category":420},"16108701","Hooks Data API",145,"data",{"id":422,"name":423,"points":424,"category":425},"16095477","Pushup alarm",134,"consumer_social",{"id":427,"name":428,"points":429,"category":19},"16117047","Nerv",133,{"id":431,"name":432,"points":433,"category":434},"16075028","developer-roadmap",130,"learning_science",false,"v2",{"id":438,"name":5,"line":5,"ai":435,"cat":19,"year":12,"points":13,"comments":14,"rec":27,"s":439,"top":17,"kw":440,"maker":10,"domain":9,"tier":18,"attempts":37,"strip":441,"url":8,"mix":442,"praise":74,"objection":94,"sub":20},16090977,0.07,[23,24,25,26],"3000000000000000000300005015103510053500",[30,17,31,17],1794036562383]