Closed stingwraith closed 2 years ago
Thanks for the feedback. Which example code are you referring to, as there are multiple and I don't think there are any with serve-index.
My apologies, I should have been more specific.
This is strictly in relation to the "Serving using express" portion.
The usage of serve-index is only from my code, but I can imagine others would want to use them in conjunction as well(provided my understanding of each of their respective functionality is correct).
You can certainly use them in conjunction. But I don't know why you had to change the example, either. I just tried the example you are referring to and added app.use(serveIndex('public/ftp'))
and it works just fine... You'll need to provide further details on your exact set up or something so we can help understand what is going on.
Specific example of using them together you can find on the serve-index page: https://github.com/expressjs/serve-index#serve-directory-indexes-with-express as it is more serve-index specific docs than serve-static.
I'm not too sure why, but I had to change your example code a bit for it to work in conjunction with serve-index, like so:
app.use("/shared", serveStatic('shared', { index: ['.jpg', '.png'] }))