Skip to content

Commit 45dbe4f

Browse files
committed
docs: add express.static to the express example
closes #64
1 parent 76e3c3a commit 45dbe4f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,12 @@ var serveIndex = require('serve-index')
127127
var app = express()
128128

129129
// Serve URLs like /ftp/thing as public/ftp/thing
130-
app.use('/ftp', serveIndex('public/ftp', {'icons': true}))
131-
app.listen()
130+
// The express.static serves the file contents
131+
// The serveIndex is this module serving the directory
132+
app.use('/ftp', express.static('public/ftp'), serveIndex('public/ftp', {'icons': true}))
133+
134+
// Listen
135+
app.listen(3000)
132136
```
133137

134138
## License

0 commit comments

Comments
 (0)