How to have custom behaviour for local and relative requests?

Can I make it so that capacitor gives my app control of what image to load for image tags like

<img src="/something/here.png">

I would like to be able to see “Okay, page is trying to load /something/here.png, let’s return X image from the filesystem”

Capacitor is already using its own server right?

Maybe there is a way for me to add rules to that server?