Using Express 3.x directory middleware
In order to mount a subdirectory, make files within it downloadable and browseable, you must remember to supply a first argument to app.use
that begins with your directory route.
app.use("/uploads", express.static('uploads'))
app.use("/uploads", express.directory('uploads'))
If you don't supply it, your route only mounts at the /
path.
Written by Andrew Hao
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Express
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#