It's not an issue (most likely) but I have to be sure.
I have directory tree similar to:
My http-server is running in app directory. If I try to include lib.css in my index.html I get 404 error. I suspect that it is normal behavior and http-server can't serve files from ancestor directories. Am I correct? Or is it something wrong with my setup and http-server is supposed to be able to serve such files
How do you include lib.css?
AFAIK, ecstatic (the lib underlying http-server) blocks requests that leave the web root.
How do you include lib.css?
<link rel="stylesheet" href="../bower_components/lib/lib.css" />
why?
Can you have a look at what HTTP status code is being returned? If you get a 403 just like ecstatic's source code implies, this is the explanation.
it's 404 - request goes to /bower_components/lib/lib.css ignoring ".." at the begining and of course it's not there.
one can see the solution here :
https://stackoverflow.com/questions/23815695/how-do-i-load-a-file-in-a-parent-directory-using-http-server/45956694#45956694
The workaround from the stackoverflow link above is NOT to access a parent directory and have your files in the same directory or child directories.
Most helpful comment
it's
404- request goes to/bower_components/lib/lib.cssignoring ".." at the begining and of course it's not there.