Created
January 12, 2018 18:11
-
-
Save simov/4e4bb0a1ecbb45b92e23608388e60909 to your computer and use it in GitHub Desktop.
Serve static files with NodeJS and Express
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 serveIndex = require('serve-index') | |
var serveStatic = require('serve-static') | |
var app = express() | |
app.use(serveStatic('/home/s')) | |
app.use('/', serveIndex('/home/s', {'icons': true, view: 'details'})) | |
app.listen(8001) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment