From 45dbe4f2196609c2f63eacbe2014c779fa9678aa Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 29 Sep 2017 00:20:54 -0400 Subject: [PATCH] docs: add express.static to the express example closes #64 --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index caeb7f50..c21db282 100644 --- a/README.md +++ b/README.md @@ -127,8 +127,12 @@ var serveIndex = require('serve-index') var app = express() // Serve URLs like /ftp/thing as public/ftp/thing -app.use('/ftp', serveIndex('public/ftp', {'icons': true})) -app.listen() +// The express.static serves the file contents +// The serveIndex is this module serving the directory +app.use('/ftp', express.static('public/ftp'), serveIndex('public/ftp', {'icons': true})) + +// Listen +app.listen(3000) ``` ## License