Hacker News new | ask | show | jobs
by bradley13 975 days ago
I get it, to some extent. I serve one of my sites with my own web server. I detest using programs that drag in zillions of dependencies over which you have no control, and every modern web server does exactly that.

That said, compiling your web content into your server? That's a step too far. Data and the application that process that data are two very different things, and (imho) should remain separate.

3 comments

That's an implementation detail. For all we know the author has a very firm split between their application folder and their blog posts folder, and they only get combined at the compilation stage. You don't need the content to be stored separately at runtime in order to maintain separation of concerns in your codebase
Compiling contents into server wouldn't be a viable strategy in many situations, like if users are allowed to upload stuff, or when you have too much content, so much that it doesn't fit in memory etc.

But for a blog that's a collection of couple dozens of text blobs few Kilobytes each -- meh, whatever. You'll get tired of your blog before it becomes a technical problem.

Deploying via go static binaries is nice, and putting a little html into the binary at compile time is a built in feature. I use that to package the swagger ui without getting complicated. But for real config, I have that in a separate file, so different flavors get different config.