Currently, the backend also servers the frontend resources. That was meant as a workaround: the original plan was to separate frontend and backend entirely, and have the frontend hosted on GitHub Pages. This didn't work out, so adding the ViteExpress server was a quick solution to get frontend assets served.
The problem: The ViteExpress impl is very memory intensive. In the range of 100-150MB, even in production, which is bonkers. We should get rid of it, and we have two options:
Adjust the whole build pipeline to build two containers: one for the backend, and one for the frontend - just a small container using nginx to serve static files
Use the express.static middleware to serve static files. This one is easy - we already build the statics into dist/, we just have to convince express to serve it.
Currently, the backend also servers the frontend resources. That was meant as a workaround: the original plan was to separate frontend and backend entirely, and have the frontend hosted on GitHub Pages. This didn't work out, so adding the
ViteExpress
server was a quick solution to get frontend assets served.The problem: The
ViteExpress
impl is very memory intensive. In the range of 100-150MB, even inproduction
, which is bonkers. We should get rid of it, and we have two options:express.static
middleware to serve static files. This one is easy - we already build the statics intodist/
, we just have to convince express to serve it.