with routes /blog and /blog/posts you are serving an html page?
how have you configured httpStatic in your settings.js file and
how is the folder structure of the static folder ?
Can you share an example flow to demonstrate the problem ?
if i had to guess .. the html serving images from /blog/posts
should have a src ../images/posts/<imageName>.jpg .. to go one level out of the url path ?
Yes I'm serving html,
in settings I use it like this > httpStatic: path.join(__dirname,"static");
static folder structure is like this:
www
--static
----images
------avatars
------banners
------etc...
----vendor
----js
----css
Well your example did the trick ../../images/posts/.jpg, I had to go two levels up.
Update:
I did some research and find this
Relative Path Summary (applicable to href, src etc.,):
/file_Or_FolderName Root directory
./file_Or_FolderName Current directory
../file_Or_FolderName Previous directory (One level up)
../../file_Or_FolderName Previous of previous directory (Two levels up)
../../../file_Or_FolderName Just like above - Three levels up
so in my case I use /file_Or_FolderName. It also works fine and don't have to worry about how deep route can go, always will return to root.