momentum-mod / website

Momentum Mod's main website.
https://momentum-mod.org
MIT License
55 stars 60 forks source link

Add Healthcheck Endpoint, Bind Server to 0.0.0.0 for Prod #956

Closed Gocnak closed 2 weeks ago

Gocnak commented 2 weeks ago

It seems like by default fastify binds to 127.0.01 which is great for localhost development but not working in Prod. They mention it in their getting started guide, and while we do have HOST bound to 0.0.0.0 in the Dockerfile, I don't actually think Fastify was reading this?

Also, I used fastify-healthcheck to add a health check endpoint for Docker and our uptime page to get a proper status of the API. I'm not married to this specific implementation, we can always roll one ourselves, but this just seemed drag-n-drop and easy enough.

tsa96 commented 2 weeks ago

Actually ugh, I think this might start responding too early, before Nest has done all it's module resolution stuff. I hate having to do a whole module for such a simple thing but actually I think it's the best approach, going to change this, one sec.

tsa96 commented 2 weeks ago

Okay there's a version as Nest module

tsa96 commented 2 weeks ago

I'll let you merge once happy with my stuff