Skip to content

Commit

Permalink
docs: add express.static to the express example
Browse files Browse the repository at this point in the history
closes #64
  • Loading branch information
dougwilson committed Sep 29, 2017
1 parent 76e3c3a commit 45dbe4f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 45dbe4f

Please sign in to comment.