Created
May 5, 2014 15:21
-
-
Save samkeen/02fe3a5d89995638d7f0 to your computer and use it in GitHub Desktop.
Simple Web Server with directory listing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
var directory = require('serve-index') | |
var logger = require('morgan') | |
var app = express() | |
app | |
.use(logger()) | |
// enable direcotry listing | |
.use(directory('public', {'icons': true})) | |
// serve files | |
.use(express.static(__dirname + '/public')) | |
app.listen(3000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment