Mohammed
Explore posts from serversCan't get serveStatic to work with `root`
Why does this not work?
app.use("/static/*", serverStatic({ root: "./static"}))
If my file is in /static/assets/myfile.txt
Then my expectation was that I can cut the /static
from he URL and access it like /assets/myfile.txt
37 replies
Can't get serveStatic to work with `root`
How I understand it is:
app.use("static/*"
should resolve all files for URLs starting with /static
and serveStatic({root: "./static"})
means it should start looking for the files in the /static
directory37 replies