how to setup custom 404 on static site(vanilla, no framework)?

i want to deploy a static site using regular html, css and js, built with vite(so not totally vanilla) but its a multipage static app, that will clearly let the server know if an undefined pageroute is accessed. I want to use a custom 404 page for these cases, I couldn't find instructions to do this.
I found this blog post
https://www.mickaelvieira.com/blog/2020/01/27/custom-404-page-with-cloudflare-workers.html
where he explains that you can kinda hack it with workers. but is this really my only option? Idk, i'm kinda hoping this can just be configured in the project's settings or something.
Mickaël Vieira
Hijacking 404 errors and returning a custom 404 page with Cloudflare Workers
Was this page helpful?