In theory it’s completely possible to use Hugo as a production server, correct?
Is anyone doing this?
Certainly, such usage of Hugo takes it out of the “static site generator” category. And of course hosting needs would change. It would require listening on port 80, right? If this is the case, it’d be the only thing “servable” from the server it’s on, correct?
Certainly with cheap ssh hosting (such as Digital Ocean, Linode, or another) this could be a really sweet (and powerful) setup. Combined with a client-side front-end admin app (talking to the Hugo server) the potential seems incredible.
Good to know… hadn’t realized this. What’s the benefit here? Perhaps they’re extending Hugo with other features (even connecting it to a database or something)?
If you’re looking for nearly instant builds on change, then Github webhooks is a good way. I use Jenkins to respnd with the commands so I don’t have to wait for cron runs. But, it’s probably safe to run cron every 60 seconds and call it done.
I serve the files from Nginx because Nginx is a much faster static file server than our old friend Apache.
@isaac It depends on the OS you are running this on, but in general the feature isn’t really designed for this. It opens a lot of files and you will run into OS limits relatively quickly.
I don’t think it would burn resources too heavily, certainly less than something like wordpress, but it does beg the question of why not do this on a cron or with triggers/hooks.
I’ve pinged the guys who wrote the watching library Hugo uses to see if they have any feedback here as well.